diff --git a/src/modules/restaurants/providers/schedule.service.ts b/src/modules/restaurants/providers/schedule.service.ts index 1c507b9..c306a71 100644 --- a/src/modules/restaurants/providers/schedule.service.ts +++ b/src/modules/restaurants/providers/schedule.service.ts @@ -1,4 +1,4 @@ -import { BadRequestException, Injectable, NotFoundException } from '@nestjs/common'; +import { Injectable, NotFoundException } from '@nestjs/common'; import { EntityManager, RequiredEntityData } from '@mikro-orm/postgresql'; import { Schedule } from '../entities/schedule.entity'; import { ScheduleRepository } from '../repositories/schedule.repository'; @@ -21,11 +21,6 @@ export class ScheduleService { throw new NotFoundException(`رستوران با شناسه ${restId} یافت نشد.`); } - const existingSchedule = await this.scheduleRepository.findOne({ restId, weekDay: createScheduleDto.weekDay }); - if (existingSchedule) { - throw new BadRequestException(`برنامه برای این روز هفته و رستوران قبلا ایجاد شده است.`); - } - const data: RequiredEntityData = { weekDay: createScheduleDto.weekDay, openTime: createScheduleDto.openTime,