refactor: enum casing (#19946)
This commit is contained in:
@@ -45,38 +45,38 @@ export class PersonController {
|
||||
}
|
||||
|
||||
@Get()
|
||||
@Authenticated({ permission: Permission.PERSON_READ })
|
||||
@Authenticated({ permission: Permission.PersonRead })
|
||||
getAllPeople(@Auth() auth: AuthDto, @Query() options: PersonSearchDto): Promise<PeopleResponseDto> {
|
||||
return this.service.getAll(auth, options);
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Authenticated({ permission: Permission.PERSON_CREATE })
|
||||
@Authenticated({ permission: Permission.PersonCreate })
|
||||
createPerson(@Auth() auth: AuthDto, @Body() dto: PersonCreateDto): Promise<PersonResponseDto> {
|
||||
return this.service.create(auth, dto);
|
||||
}
|
||||
|
||||
@Put()
|
||||
@Authenticated({ permission: Permission.PERSON_UPDATE })
|
||||
@Authenticated({ permission: Permission.PersonUpdate })
|
||||
updatePeople(@Auth() auth: AuthDto, @Body() dto: PeopleUpdateDto): Promise<BulkIdResponseDto[]> {
|
||||
return this.service.updateAll(auth, dto);
|
||||
}
|
||||
|
||||
@Delete()
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Authenticated({ permission: Permission.PERSON_DELETE })
|
||||
@Authenticated({ permission: Permission.PersonDelete })
|
||||
deletePeople(@Auth() auth: AuthDto, @Body() dto: BulkIdsDto): Promise<void> {
|
||||
return this.service.deleteAll(auth, dto);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
@Authenticated({ permission: Permission.PERSON_READ })
|
||||
@Authenticated({ permission: Permission.PersonRead })
|
||||
getPerson(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<PersonResponseDto> {
|
||||
return this.service.getById(auth, id);
|
||||
}
|
||||
|
||||
@Put(':id')
|
||||
@Authenticated({ permission: Permission.PERSON_UPDATE })
|
||||
@Authenticated({ permission: Permission.PersonUpdate })
|
||||
updatePerson(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
@@ -87,20 +87,20 @@ export class PersonController {
|
||||
|
||||
@Delete(':id')
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Authenticated({ permission: Permission.PERSON_DELETE })
|
||||
@Authenticated({ permission: Permission.PersonDelete })
|
||||
deletePerson(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<void> {
|
||||
return this.service.delete(auth, id);
|
||||
}
|
||||
|
||||
@Get(':id/statistics')
|
||||
@Authenticated({ permission: Permission.PERSON_STATISTICS })
|
||||
@Authenticated({ permission: Permission.PersonStatistics })
|
||||
getPersonStatistics(@Auth() auth: AuthDto, @Param() { id }: UUIDParamDto): Promise<PersonStatisticsResponseDto> {
|
||||
return this.service.getStatistics(auth, id);
|
||||
}
|
||||
|
||||
@Get(':id/thumbnail')
|
||||
@FileResponse()
|
||||
@Authenticated({ permission: Permission.PERSON_READ })
|
||||
@Authenticated({ permission: Permission.PersonRead })
|
||||
async getPersonThumbnail(
|
||||
@Res() res: Response,
|
||||
@Next() next: NextFunction,
|
||||
@@ -111,7 +111,7 @@ export class PersonController {
|
||||
}
|
||||
|
||||
@Put(':id/reassign')
|
||||
@Authenticated({ permission: Permission.PERSON_REASSIGN })
|
||||
@Authenticated({ permission: Permission.PersonReassign })
|
||||
reassignFaces(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
@@ -121,7 +121,7 @@ export class PersonController {
|
||||
}
|
||||
|
||||
@Post(':id/merge')
|
||||
@Authenticated({ permission: Permission.PERSON_MERGE })
|
||||
@Authenticated({ permission: Permission.PersonMerge })
|
||||
mergePerson(
|
||||
@Auth() auth: AuthDto,
|
||||
@Param() { id }: UUIDParamDto,
|
||||
|
||||
Reference in New Issue
Block a user