refactor: more database types (#17490)

This commit is contained in:
Jason Rasmussen
2025-04-09 10:24:38 -04:00
committed by GitHub
parent 04b03f2924
commit 8943ec23ba
12 changed files with 123 additions and 148 deletions
+2 -2
View File
@@ -1,11 +1,11 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsEnum, IsInt, IsNotEmpty, IsString, Max, Min } from 'class-validator';
import { Place } from 'src/database';
import { PropertyLifecycle } from 'src/decorators';
import { AlbumResponseDto } from 'src/dtos/album.dto';
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
import { AssetOrder, AssetType } from 'src/enum';
import { SearchPlacesItem } from 'src/types';
import { Optional, ValidateBoolean, ValidateDate, ValidateUUID } from 'src/validation';
class BaseSearchDto {
@@ -226,7 +226,7 @@ export class PlacesResponseDto {
admin2name?: string;
}
export function mapPlaces(place: SearchPlacesItem): PlacesResponseDto {
export function mapPlaces(place: Place): PlacesResponseDto {
return {
name: place.name,
latitude: place.latitude,
+2 -2
View File
@@ -1,4 +1,4 @@
import { SessionItem } from 'src/types';
import { Session } from 'src/database';
export class SessionResponseDto {
id!: string;
@@ -9,7 +9,7 @@ export class SessionResponseDto {
deviceOS!: string;
}
export const mapSession = (entity: SessionItem, currentId?: string): SessionResponseDto => ({
export const mapSession = (entity: Session, currentId?: string): SessionResponseDto => ({
id: entity.id,
createdAt: entity.createdAt.toISOString(),
updatedAt: entity.updatedAt.toISOString(),