mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-11 07:38:49 +00:00
add includeSpaces in the query param
This commit is contained in:
@ -1,11 +1,24 @@
|
||||
import { IsDate, IsOptional } from 'class-validator';
|
||||
import { IsBoolean, IsDate, IsOptional } from 'class-validator';
|
||||
import { IsPageRequestParam } from '../validators/is-page-request-param.validator';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsSizeRequestParam } from '../validators/is-size-request-param.validator';
|
||||
import { Transform } from 'class-transformer';
|
||||
import { parseToDate } from '../util/parseToDate';
|
||||
import { BooleanValues } from '../constants/boolean-values.enum';
|
||||
|
||||
export class PaginationRequestGetListDto {
|
||||
@ApiProperty({
|
||||
example: true,
|
||||
description: 'include spaces',
|
||||
required: false,
|
||||
default: false,
|
||||
})
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
@Transform((value) => {
|
||||
return value.obj.includeSpaces === BooleanValues.TRUE;
|
||||
})
|
||||
public includeSpaces?: boolean = false;
|
||||
@IsOptional()
|
||||
@IsPageRequestParam({
|
||||
message: 'Page must be bigger than 0',
|
||||
|
Reference in New Issue
Block a user