up
This commit is contained in:
@@ -39,7 +39,7 @@ export class ScheduleController {
|
|||||||
name: 'weekDay',
|
name: 'weekDay',
|
||||||
required: false,
|
required: false,
|
||||||
type: Number,
|
type: Number,
|
||||||
description: 'Filter by week days (0=Sunday, 6=Saturday). Can pass multiple: ?weekDay=0&weekDay=1&weekDay=2',
|
description: 'Filter by week days (0=Sunday, 6=Saturday).',
|
||||||
})
|
})
|
||||||
@ApiOkResponse({ description: 'List of schedules', type: [Schedule] })
|
@ApiOkResponse({ description: 'List of schedules', type: [Schedule] })
|
||||||
findAll(
|
findAll(
|
||||||
|
|||||||
@@ -1,15 +1,16 @@
|
|||||||
import { IsOptional, IsNumber, Min, Max } from 'class-validator';
|
import { IsOptional, IsNumber, Min, Max } from 'class-validator';
|
||||||
import { ApiPropertyOptional } from '@nestjs/swagger';
|
import { ApiPropertyOptional } from '@nestjs/swagger';
|
||||||
|
import { Type } from 'class-transformer';
|
||||||
|
|
||||||
export class FindSchedulesDto {
|
export class FindSchedulesDto {
|
||||||
@IsOptional()
|
@IsOptional()
|
||||||
@IsNumber({}, { each: true })
|
@Type(() => Number)
|
||||||
@Min(0, { each: true })
|
@IsNumber()
|
||||||
@Max(6, { each: true })
|
@Min(0)
|
||||||
|
@Max(6)
|
||||||
@ApiPropertyOptional({
|
@ApiPropertyOptional({
|
||||||
example: 0,
|
|
||||||
description: 'Filter by week days (0=Sunday, 6=Saturday)',
|
description: 'Filter by week days (0=Sunday, 6=Saturday)',
|
||||||
type: [Number],
|
type: Number,
|
||||||
})
|
})
|
||||||
weekDay?: number[];
|
weekDay?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user