refactor: deduplicate MemoryType and ReactionType enums ()

* refactor: deduplicate memorytype and reactiontype enums

* fix mobile
This commit is contained in:
Michel Heusschen 2024-07-31 19:08:31 +02:00 committed by GitHub
commit b73f7fe16f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 18 additions and 176 deletions

View file

@ -19,6 +19,7 @@ export type MaybeDuplicate<T> = { duplicate: boolean; value: T };
export class ActivityResponseDto {
id!: string;
createdAt!: Date;
@ApiProperty({ enumName: 'ReactionType', enum: ReactionType })
type!: ReactionType;
user!: UserResponseDto;
assetId!: string | null;
@ -53,7 +54,7 @@ export class ActivitySearchDto extends ActivityDto {
userId?: string;
}
const isComment = (dto: ActivityCreateDto) => dto.type === 'comment';
const isComment = (dto: ActivityCreateDto) => dto.type === ReactionType.COMMENT;
export class ActivityCreateDto extends ActivityDto {
@IsEnum(ReactionType)

View file

@ -61,6 +61,7 @@ export class MemoryResponseDto {
memoryAt!: Date;
seenAt?: Date;
ownerId!: string;
@ApiProperty({ enumName: 'MemoryType', enum: MemoryType })
type!: MemoryType;
data!: MemoryData;
isSaved!: boolean;