mirror of
https://github.com/immich-app/immich.git
synced 2025-12-17 17:23:20 +03:00
refactor(server): upload config (#3148)
This commit is contained in:
@@ -25,15 +25,14 @@ import {
|
||||
UploadedFile,
|
||||
UseInterceptors,
|
||||
} from '@nestjs/common';
|
||||
import { FileInterceptor } from '@nestjs/platform-express';
|
||||
import { ApiBody, ApiConsumes, ApiTags } from '@nestjs/swagger';
|
||||
import { Response as Res } from 'express';
|
||||
import { AdminRoute, Authenticated, AuthUser, PublicRoute } from '../app.guard';
|
||||
import { FileUploadInterceptor, Route } from '../app.interceptor';
|
||||
import { UseValidation } from '../app.utils';
|
||||
import { profileImageUploadOption } from '../config/profile-image-upload.config';
|
||||
|
||||
@ApiTags('User')
|
||||
@Controller('user')
|
||||
@Controller(Route.USER)
|
||||
@Authenticated()
|
||||
@UseValidation()
|
||||
export class UserController {
|
||||
@@ -83,12 +82,9 @@ export class UserController {
|
||||
return this.service.updateUser(authUser, updateUserDto);
|
||||
}
|
||||
|
||||
@UseInterceptors(FileInterceptor('file', profileImageUploadOption))
|
||||
@UseInterceptors(FileUploadInterceptor)
|
||||
@ApiConsumes('multipart/form-data')
|
||||
@ApiBody({
|
||||
description: 'A new avatar for the user',
|
||||
type: CreateProfileImageDto,
|
||||
})
|
||||
@ApiBody({ description: 'A new avatar for the user', type: CreateProfileImageDto })
|
||||
@Post('/profile-image')
|
||||
createProfileImage(
|
||||
@AuthUser() authUser: AuthUserDto,
|
||||
|
||||
Reference in New Issue
Block a user