mirror of
https://github.com/immich-app/immich.git
synced 2025-12-27 01:11:42 +03:00
refactor(server): auth route metadata (#9344)
This commit is contained in:
@@ -9,23 +9,25 @@ import { UUIDParamDto } from 'src/validation';
|
||||
|
||||
@ApiTags('Partner')
|
||||
@Controller('partner')
|
||||
@Authenticated()
|
||||
export class PartnerController {
|
||||
constructor(private service: PartnerService) {}
|
||||
|
||||
@Get()
|
||||
@ApiQuery({ name: 'direction', type: 'string', enum: PartnerDirection, required: true })
|
||||
@Authenticated()
|
||||
// TODO: remove 'direction' and convert to full query dto
|
||||
getPartners(@Auth() auth: AuthDto, @Query('direction') direction: PartnerDirection): Promise<PartnerResponseDto[]> {
|
||||
return this.service.getAll(auth, direction);
|
||||
}
|
||||
|
||||
@Post(':id')
|
||||
@Authenticated()
|
||||
createPartner(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<PartnerResponseDto> {
|
||||
return this.service.create(auth, id);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@Authenticated()
|
||||
updatePartner(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
@@ -35,6 +37,7 @@ export class PartnerController {
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
@Authenticated()
|
||||
removePartner(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<void> {
|
||||
return this.service.remove(auth, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user