1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-09 21:36:46 +01:00
immich/server/libs/domain/src/search/dto/search.dto.ts
Sergey Kondrikov d314805caf
feat (server, web): Implement Archive (#2225)
* feat (server, web): add archive

* chore: generate api

* feat (web): add empty placeholder for archive page

* chore: remove title on favorites page

Duplicates sidebar selection. Two pages (Archive and Favorites)
are consistent now

* refactor (web): create EmptyPlaceholder component for empty pages

* fixed menu close button not close:

* fix (web): remove not necessary store call

* test (web): simplify asset tests code

* test (web): simplify asset tests code

* chore (server): remove isArchived while uploading

* chore (server): remove isArchived from typesense schema

* chore: generate api

* fix (web): delete asset from archive page

* chore: change archive asset count endpoint

old endpoint: /asset/archived-count-by-user-id
new endpoint: /asset/stat/archive

* chore: generate api

---------

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2023-04-12 10:37:52 -05:00

82 lines
1.5 KiB
TypeScript

import { AssetType } from '@app/infra/entities';
import { Transform } from 'class-transformer';
import { IsArray, IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator';
import { toBoolean } from '../../../../../apps/immich/src/utils/transform.util';
export class SearchDto {
@IsString()
@IsNotEmpty()
@IsOptional()
q?: string;
@IsString()
@IsNotEmpty()
@IsOptional()
query?: string;
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
clip?: boolean;
@IsEnum(AssetType)
@IsOptional()
type?: AssetType;
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
isFavorite?: boolean;
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
isArchived?: boolean;
@IsString()
@IsNotEmpty()
@IsOptional()
'exifInfo.city'?: string;
@IsString()
@IsNotEmpty()
@IsOptional()
'exifInfo.state'?: string;
@IsString()
@IsNotEmpty()
@IsOptional()
'exifInfo.country'?: string;
@IsString()
@IsNotEmpty()
@IsOptional()
'exifInfo.make'?: string;
@IsString()
@IsNotEmpty()
@IsOptional()
'exifInfo.model'?: string;
@IsString({ each: true })
@IsArray()
@IsOptional()
@Transform(({ value }) => value.split(','))
'smartInfo.objects'?: string[];
@IsString({ each: true })
@IsArray()
@IsOptional()
@Transform(({ value }) => value.split(','))
'smartInfo.tags'?: string[];
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
recent?: boolean;
@IsBoolean()
@IsOptional()
@Transform(toBoolean)
motion?: boolean;
}