From 7676dd62c8f70d73d8705332fcdab6f96cd37efd Mon Sep 17 00:00:00 2001 From: avicenan Date: Thu, 26 Feb 2026 11:22:56 +0700 Subject: [PATCH] fix: doctor schedule search by room & doctor --- src/model/doctor_schedule.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/model/doctor_schedule.ts b/src/model/doctor_schedule.ts index e40b82f..1091f97 100644 --- a/src/model/doctor_schedule.ts +++ b/src/model/doctor_schedule.ts @@ -9,12 +9,13 @@ export class DoctorScheduleModel { let whereAttr: string[] = []; let whereVal: any = {}; if (filter && Object.keys(filter).length > 0) { - whereAttr = [...whereAttr, ...CommonHelper.handleQueryFilter(filter).whereAttr]; - whereVal = { ...whereVal, ...CommonHelper.handleQueryFilter(filter).whereVal }; + const filterResult = CommonHelper.handleQueryFilter(filter); + whereAttr = [...whereAttr, ...filterResult.whereAttr]; + whereVal = { ...whereVal, ...filterResult.whereVal }; } var query = repo.createQueryBuilder("DoctorSchedule") - .leftJoinAndSelect("DoctorSchedule.doctor", "doctor") + .leftJoinAndSelect("DoctorSchedule.doctor", "Doctor") .leftJoinAndSelect("DoctorSchedule.room", "Room"); if (whereAttr.length != 0) { query = query.where(whereAttr.join(" and "), whereVal);