schedule bug
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user