From f4c73a8f961754b3b60490f77db870391e42b1c7 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Sat, 17 Oct 2020 20:58:10 +0200 Subject: [PATCH] Use `POST /media` for file upload The old `/media/upload` subpath does not follow the convention of REST APIs. Signed-off-by: David Mehren --- docs/dev/public_api.yml | 2 +- src/api/public/media/media.controller.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/dev/public_api.yml b/docs/dev/public_api.yml index be897596f..62a131b85 100644 --- a/docs/dev/public_api.yml +++ b/docs/dev/public_api.yml @@ -454,7 +454,7 @@ paths: content: text/plain: example: my-note - /media/upload: + /media: post: tags: - media diff --git a/src/api/public/media/media.controller.ts b/src/api/public/media/media.controller.ts index a2dc65ac4..9627a5054 100644 --- a/src/api/public/media/media.controller.ts +++ b/src/api/public/media/media.controller.ts @@ -23,7 +23,7 @@ export class MediaController { this.logger.setContext(MediaController.name); } - @Post('upload') + @Post() @UseInterceptors(FileInterceptor('file')) async uploadImage( @UploadedFile() file: MulterFile,