Add optional scheduleList property to AddDoorLockOnlineDto class

This commit is contained in:
faris Aljohari
2024-06-29 17:20:45 +03:00
parent 1cfef6c7b2
commit 8bc0961869

View File

@ -6,6 +6,7 @@ import {
ValidateNested, ValidateNested,
IsEnum, IsEnum,
Length, Length,
IsOptional,
} from 'class-validator'; } from 'class-validator';
import { Type } from 'class-transformer'; import { Type } from 'class-transformer';
import { WorkingDays } from '@app/common/constants/working-days'; import { WorkingDays } from '@app/common/constants/working-days';
@ -79,6 +80,7 @@ export class AddDoorLockOnlineDto {
}) })
@IsArray() @IsArray()
@ValidateNested({ each: true }) @ValidateNested({ each: true })
@IsOptional()
@Type(() => ScheduleDto) @Type(() => ScheduleDto)
public scheduleList: ScheduleDto[]; public scheduleList: ScheduleDto[];
} }