mirror of
https://github.com/immich-app/immich.git
synced 2025-12-19 17:23:21 +03:00
20 lines
528 B
TypeScript
20 lines
528 B
TypeScript
|
|
import { SessionEntity } from 'src/entities/session.entity';
|
||
|
|
|
||
|
|
export class SessionResponseDto {
|
||
|
|
id!: string;
|
||
|
|
createdAt!: string;
|
||
|
|
updatedAt!: string;
|
||
|
|
current!: boolean;
|
||
|
|
deviceType!: string;
|
||
|
|
deviceOS!: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const mapSession = (entity: SessionEntity, currentId?: string): SessionResponseDto => ({
|
||
|
|
id: entity.id,
|
||
|
|
createdAt: entity.createdAt.toISOString(),
|
||
|
|
updatedAt: entity.updatedAt.toISOString(),
|
||
|
|
current: currentId === entity.id,
|
||
|
|
deviceOS: entity.deviceOS,
|
||
|
|
deviceType: entity.deviceType,
|
||
|
|
});
|