Skip to content

Commit 9895953

Browse files
committed
HACKGT13 TEMP: sort apps by confirmed first if userId filter provided (fix walkup checkins)
1 parent 5c0bac5 commit 9895953

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎services/registration/src/routes/application.ts‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,20 @@ applicationRouter.route("/").get(
112112
.select(select);
113113
}
114114

115+
// sort applications by confirmed first if we are filtering by a specific userId
116+
// (TODO) workaround for letting app check in denied ppl during walkin checkin
117+
if (req.query.userId) {
118+
applications.sort((a, b) => {
119+
if (a.status === StatusType.CONFIRMED && b.status !== StatusType.CONFIRMED) {
120+
return -1;
121+
}
122+
if (a.status !== StatusType.CONFIRMED && b.status === StatusType.CONFIRMED) {
123+
return 1;
124+
}
125+
return 0;
126+
});
127+
}
128+
115129
return res.status(200).json({
116130
offset,
117131
total,

0 commit comments

Comments
 (0)