add decks crud

This commit is contained in:
2023-06-17 23:27:23 +02:00
parent 9cd6595ae2
commit 36e54cf56f
23 changed files with 405 additions and 35 deletions

View File

@@ -0,0 +1,2 @@
export const DEFAULT_PAGE_SIZE = 10
export const DEFAULT_PAGE_NUMBER = 1

View File

@@ -0,0 +1,14 @@
import { IsNumber, IsOptional } from 'class-validator'
import { Type } from 'class-transformer'
export class PaginationDto {
@IsOptional()
@Type(() => Number)
@IsNumber()
currentPage?: number
@Type(() => Number)
@IsOptional()
@IsNumber()
pageSize?: number
}

View File

@@ -0,0 +1,7 @@
import { ValidateIf, ValidationOptions } from 'class-validator'
export function IsOptionalOrEmptyString(validationOptions?: ValidationOptions) {
return ValidateIf((obj, value) => {
return value !== null && value !== undefined && value !== ''
}, validationOptions)
}