Files
immich/server/src/domain/user/response-dto/user-response.dto.ts
Alex 0d80ae3a91 fix(mobile): make user.memoryEnable optional (#3680)
* chore(server): avoid breaking changes

* generate api

* mobile app
2023-08-14 12:52:06 -05:00

38 lines
996 B
TypeScript

import { UserEntity } from '@app/infra/entities';
export class UserResponseDto {
id!: string;
email!: string;
firstName!: string;
lastName!: string;
storageLabel!: string | null;
externalPath!: string | null;
profileImagePath!: string;
shouldChangePassword!: boolean;
isAdmin!: boolean;
createdAt!: Date;
deletedAt!: Date | null;
updatedAt!: Date;
oauthId!: string;
memoriesEnabled?: boolean;
}
export function mapUser(entity: UserEntity): UserResponseDto {
return {
id: entity.id,
email: entity.email,
firstName: entity.firstName,
lastName: entity.lastName,
storageLabel: entity.storageLabel,
externalPath: entity.externalPath,
profileImagePath: entity.profileImagePath,
shouldChangePassword: entity.shouldChangePassword,
isAdmin: entity.isAdmin,
createdAt: entity.createdAt,
deletedAt: entity.deletedAt,
updatedAt: entity.updatedAt,
oauthId: entity.oauthId,
memoriesEnabled: entity.memoriesEnabled,
};
}