refactor media module
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Controller, Post, Get, Delete, Put, Body, HttpStatus, Res, Param, UseInterceptors, UploadedFile } from '@nestjs/common';
|
||||
import { ApiTags, ApiResponse, ApiOperation, ApiParam, ApiConsumes } from '@nestjs/swagger';
|
||||
import { Response } from 'express';
|
||||
import type { Response } from 'express';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { MediaService } from './MediaService';
|
||||
import { RequestAvatarGenerationInputDTO } from './dtos/RequestAvatarGenerationInputDTO';
|
||||
@@ -12,6 +12,7 @@ import { DeleteMediaOutputDTO } from './dtos/DeleteMediaOutputDTO';
|
||||
import { GetAvatarOutputDTO } from './dtos/GetAvatarOutputDTO';
|
||||
import { UpdateAvatarInputDTO } from './dtos/UpdateAvatarInputDTO';
|
||||
import { UpdateAvatarOutputDTO } from './dtos/UpdateAvatarOutputDTO';
|
||||
import type { MulterFile } from './types/MulterFile';
|
||||
|
||||
type RequestAvatarGenerationInput = RequestAvatarGenerationInputDTO;
|
||||
type UploadMediaInput = UploadMediaInputDTO;
|
||||
@@ -44,7 +45,7 @@ export class MediaController {
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiResponse({ status: 201, description: 'Media uploaded successfully', type: UploadMediaOutputDTO })
|
||||
async uploadMedia(
|
||||
@UploadedFile() file: Express.Multer.File,
|
||||
@UploadedFile() file: MulterFile,
|
||||
@Body() input: UploadMediaInput,
|
||||
@Res() res: Response,
|
||||
): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user