refactor: small face tests (#26340)

This commit is contained in:
Daniel Dietzler
2026-02-19 14:51:18 +01:00
committed by GitHub
parent e0bb5f70ec
commit d0ed76dc37
9 changed files with 287 additions and 394 deletions
+2 -6
View File
@@ -197,13 +197,9 @@ export class PersonService extends BaseService {
let faceId: string | undefined = undefined;
if (assetId) {
await this.requireAccess({ auth, permission: Permission.AssetRead, ids: [assetId] });
const [face] = await this.personRepository.getFacesByIds([{ personId: id, assetId }]);
const face = await this.personRepository.getForFeatureFaceUpdate({ personId: id, assetId });
if (!face) {
throw new BadRequestException('Invalid assetId for feature face');
}
if (face.asset.isOffline) {
throw new BadRequestException('An offline asset cannot be used for feature face');
throw new BadRequestException('Invalid assetId for feature face or asset is offline');
}
faceId = face.id;