bug
This commit is contained in:
@@ -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<Schedule> = {
|
||||
weekDay: createScheduleDto.weekDay,
|
||||
openTime: createScheduleDto.openTime,
|
||||
|
||||
Reference in New Issue
Block a user