We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2940aed commit afe154eCopy full SHA for afe154e
1 file changed
src/controllers/aptcontrol.js
@@ -37,7 +37,8 @@ const getAppointments = async (req, res) => {
37
const appointments = await Appointment.find(query)
38
.populate('patient', 'name email')
39
.populate('doctor', 'name spec')
40
- .populate('dept', 'dept');
+ .populate('dept', 'dept')
41
+ .lean();
42
43
res.json(appointments);
44
} catch (err) {
@@ -51,7 +52,8 @@ const getAppointmentById = async (req, res) => {
51
52
const appointment = await Appointment.findById(req.params.id)
53
54
55
56
57
58
if (!appointment) return res.status(404).json({ message: 'Appointment not found' });
59
0 commit comments