From ce37ae63d271659618744bf0d245b2c3cc49bf55 Mon Sep 17 00:00:00 2001 From: Tom Coombs Date: Fri, 23 Feb 2024 09:16:05 -0500 Subject: [PATCH] sort the open training sessions list --- controllers/TrainingController.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/controllers/TrainingController.js b/controllers/TrainingController.js index 0eea3d6..e625b40 100644 --- a/controllers/TrainingController.js +++ b/controllers/TrainingController.js @@ -532,7 +532,10 @@ router.get('/session/open', getUser, auth(['atm', 'datm', 'ta', 'ins', 'mtr', 'w instructorCid: res.user.cid, deleted: false, submitted: false - }).populate('student', 'fname lname cid vis').populate('milestone', 'name code').lean(); + }).populate('student', 'fname lname cid vis') + .populate('milestone', 'name code') + .sort( { startTime: 1 }) + .lean(); res.stdRes.data = sessions; } catch(e) {