refactor(server): tags (#2589)

* refactor: tags

* chore: open api

* chore: unused import

* feat: add/remove/get tag assets

* chore: open api

* chore: finish tag tests for add/remove assets
This commit is contained in:
Jason Rasmussen
2023-05-31 21:51:28 -04:00
committed by GitHub
parent 631f13cf2f
commit 656dc08406
54 changed files with 2336 additions and 816 deletions

View File

@@ -2,17 +2,19 @@ import {
AlbumEntity,
APIKeyEntity,
AssetEntity,
AssetFaceEntity,
AssetType,
PersonEntity,
ExifEntity,
PartnerEntity,
PersonEntity,
SharedLinkEntity,
SharedLinkType,
SystemConfig,
TagEntity,
TagType,
TranscodePreset,
UserEntity,
UserTokenEntity,
AssetFaceEntity,
ExifEntity,
} from '@app/infra/entities';
import {
AlbumResponseDto,
@@ -23,6 +25,7 @@ import {
mapUser,
SearchResult,
SharedLinkResponseDto,
TagResponseDto,
VideoFormat,
VideoInfo,
VideoStreamInfo,
@@ -988,3 +991,24 @@ export const faceStub = {
embedding: [1, 2, 3, 4],
}),
};
export const tagStub = {
tag1: Object.freeze<TagEntity>({
id: 'tag-1',
name: 'Tag1',
type: TagType.CUSTOM,
userId: userEntityStub.admin.id,
user: userEntityStub.admin,
renameTagId: null,
assets: [],
}),
};
export const tagResponseStub = {
tag1: Object.freeze<TagResponseDto>({
id: 'tag-1',
name: 'Tag1',
type: 'CUSTOM',
userId: 'admin_id',
}),
};