schedule bug

This commit is contained in:
2025-11-22 16:03:03 +03:30
parent 23dc27e611
commit f30b1729d3
2 changed files with 11 additions and 9 deletions
@@ -46,16 +46,17 @@ export class ScheduleService {
return this.scheduleRepository.find(where, { orderBy: { weekDay: 'asc' } });
}
async findTodaySchedules(): Promise<Schedule[]> {
async findTodaySchedules(restId: string): Promise<Schedule | null> {
const today = new Date();
const weekDay = today.getDay(); // 0 = Sunday, 6 = Saturday
const where: FilterQuery<Schedule> = {
restId,
weekDay,
isActive: true,
};
return this.scheduleRepository.find(where, { orderBy: { openTime: 'asc' } });
return this.scheduleRepository.findOne(where);
}
async findOne(id: string, restId: string): Promise<Schedule> {