Files
immich/server/src/dtos/session.dto.ts

20 lines
501 B
TypeScript
Raw Normal View History

2025-04-09 10:24:38 -04:00
import { Session } from 'src/database';
export class SessionResponseDto {
id!: string;
createdAt!: string;
updatedAt!: string;
current!: boolean;
deviceType!: string;
deviceOS!: string;
}
2025-04-09 10:24:38 -04:00
export const mapSession = (entity: Session, currentId?: string): SessionResponseDto => ({
id: entity.id,
createdAt: entity.createdAt.toISOString(),
updatedAt: entity.updatedAt.toISOString(),
current: currentId === entity.id,
deviceOS: entity.deviceOS,
deviceType: entity.deviceType,
});