mirror of https://github.com/immich-app/immich.git
fix(server): non-nullable `IsOptional` (#3939)
* custom `IsOptional` * added link to source * formatting * Update server/src/domain/domain.util.ts Co-authored-by: Jason Rasmussen <jrasm91@gmail.com> * nullable birth date endpoint * made `nullable` a property * formatting * removed unused dto * updated decorator arg * fixed album e2e tests * add null tests for auth e2e * add null test for person e2e * fixed tests * added null test for user e2e * removed unusued import * log key in test name * chore: add note about mobile not being able to use the endpoint --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>pull/3948/head
parent
ca35e5557b
commit
9539a361e4
@ -1,12 +1,13 @@
|
||||
import { IsBoolean, IsOptional } from 'class-validator';
|
||||
import { IsBoolean } from 'class-validator';
|
||||
import { BulkIdsDto } from '../response-dto';
|
||||
import { Optional } from '../../domain.util';
|
||||
|
||||
export class AssetBulkUpdateDto extends BulkIdsDto {
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@IsBoolean()
|
||||
isFavorite?: boolean;
|
||||
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@IsBoolean()
|
||||
isArchived?: boolean;
|
||||
}
|
||||
|
||||
@ -1,87 +1,87 @@
|
||||
import { AssetType } from '@app/infra/entities';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import { toBoolean } from '../../domain.util';
|
||||
import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
import { toBoolean, Optional } from '../../domain.util';
|
||||
|
||||
export class SearchDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
q?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
query?: string;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(toBoolean)
|
||||
clip?: boolean;
|
||||
|
||||
@IsEnum(AssetType)
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
type?: AssetType;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(toBoolean)
|
||||
isFavorite?: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(toBoolean)
|
||||
isArchived?: boolean;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.city'?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.state'?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.country'?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.make'?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.model'?: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
'exifInfo.projectionType'?: string;
|
||||
|
||||
@IsString({ each: true })
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(({ value }) => value.split(','))
|
||||
'smartInfo.objects'?: string[];
|
||||
|
||||
@IsString({ each: true })
|
||||
@IsArray()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(({ value }) => value.split(','))
|
||||
'smartInfo.tags'?: string[];
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(toBoolean)
|
||||
recent?: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
@Optional()
|
||||
@Transform(toBoolean)
|
||||
motion?: boolean;
|
||||
}
|
||||
|
||||
@ -1,45 +0,0 @@
|
||||
import { IsNotEmpty, IsOptional } from 'class-validator';
|
||||
|
||||
export class CreateExifDto {
|
||||
@IsNotEmpty()
|
||||
assetId!: string;
|
||||
|
||||
@IsOptional()
|
||||
make?: string;
|
||||
|
||||
@IsOptional()
|
||||
model?: string;
|
||||
|
||||
@IsOptional()
|
||||
exifImageWidth?: number;
|
||||
|
||||
@IsOptional()
|
||||
exifImageHeight?: number;
|
||||
|
||||
@IsOptional()
|
||||
fileSizeInByte?: number;
|
||||
|
||||
@IsOptional()
|
||||
orientation?: string;
|
||||
|
||||
@IsOptional()
|
||||
dateTimeOriginal?: Date;
|
||||
|
||||
@IsOptional()
|
||||
modifiedDate?: Date;
|
||||
|
||||
@IsOptional()
|
||||
lensModel?: string;
|
||||
|
||||
@IsOptional()
|
||||
fNumber?: number;
|
||||
|
||||
@IsOptional()
|
||||
focalLenght?: number;
|
||||
|
||||
@IsOptional()
|
||||
iso?: number;
|
||||
|
||||
@IsOptional()
|
||||
exposureTime?: number;
|
||||
}
|
||||
Loading…
Reference in New Issue