refactor: api validators (boolean and date) (#7709)
* refactor: api validators (boolean and date) * chore: open api * revert: time bucket change
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { IsBoolean, IsString } from 'class-validator';
|
||||
import { Optional, ValidateUUID } from '../../domain.util';
|
||||
import { IsString } from 'class-validator';
|
||||
import { Optional, ValidateBoolean, ValidateUUID } from '../../domain.util';
|
||||
|
||||
export class UpdateAlbumDto {
|
||||
@Optional()
|
||||
@@ -13,7 +13,6 @@ export class UpdateAlbumDto {
|
||||
@ValidateUUID({ optional: true })
|
||||
albumThumbnailAssetId?: string;
|
||||
|
||||
@Optional()
|
||||
@IsBoolean()
|
||||
@ValidateBoolean({ optional: true })
|
||||
isActivityEnabled?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsBoolean } from 'class-validator';
|
||||
import { Optional, toBoolean } from '../../domain.util';
|
||||
import { ValidateBoolean } from '../../domain.util';
|
||||
|
||||
export class AlbumInfoDto {
|
||||
@Optional()
|
||||
@IsBoolean()
|
||||
@Transform(toBoolean)
|
||||
@ValidateBoolean({ optional: true })
|
||||
withoutAssets?: boolean;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsBoolean } from 'class-validator';
|
||||
import { Optional, toBoolean, ValidateUUID } from '../../domain.util';
|
||||
import { ValidateBoolean, ValidateUUID } from '../../domain.util';
|
||||
|
||||
export class GetAlbumsDto {
|
||||
@Optional()
|
||||
@IsBoolean()
|
||||
@Transform(toBoolean)
|
||||
@ApiProperty()
|
||||
@ValidateBoolean({ optional: true })
|
||||
/**
|
||||
* true: only shared albums
|
||||
* false: only non-shared own albums
|
||||
|
||||
Reference in New Issue
Block a user