mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04:00
* rename api tags to follow plural nomenclature of endpoints * chore: open api * fix mobile
30 lines
958 B
TypeScript
30 lines
958 B
TypeScript
import { Body, Controller, Get, Param, Put, Query } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
|
import { AssetFaceResponseDto, FaceDto, PersonResponseDto } from 'src/dtos/person.dto';
|
|
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
|
import { PersonService } from 'src/services/person.service';
|
|
import { UUIDParamDto } from 'src/validation';
|
|
|
|
@ApiTags('Faces')
|
|
@Controller('faces')
|
|
export class FaceController {
|
|
constructor(private service: PersonService) {}
|
|
|
|
@Get()
|
|
@Authenticated()
|
|
getFaces(@Auth() auth: AuthDto, @Query() dto: FaceDto): Promise<AssetFaceResponseDto[]> {
|
|
return this.service.getFacesById(auth, dto);
|
|
}
|
|
|
|
@Put(':id')
|
|
@Authenticated()
|
|
reassignFacesById(
|
|
@Auth() auth: AuthDto,
|
|
@Param() { id }: UUIDParamDto,
|
|
@Body() dto: FaceDto,
|
|
): Promise<PersonResponseDto> {
|
|
return this.service.reassignFacesById(auth, id, dto);
|
|
}
|
|
}
|