Skip to content

Commit cfaa0c2

Browse files
revert: hotfix to query application by createdAt (#2090)
Co-authored-by: Amit Prakash <34869115+iamitprakash@users.noreply.github.com>
1 parent 3fbf6c2 commit cfaa0c2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

models/applications.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,8 @@ const getAllApplications = async (limit: number, lastDocId?: string) => {
6060
if (lastDocId) {
6161
lastDoc = await ApplicationsModel.doc(lastDocId).get();
6262
}
63-
// Hot-fix: Sorting by userId due to missing created field in some entries.
64-
// Revert to createdAt once the field is updated.
65-
// https://github.com/Real-Dev-Squad/website-backend/issues/2084
66-
let dbQuery = ApplicationsModel.orderBy("userId", "desc");
63+
64+
let dbQuery = ApplicationsModel.orderBy("createdAt", "desc");
6765

6866
if (lastDoc) {
6967
dbQuery = dbQuery.startAfter(lastDoc);
@@ -116,10 +114,7 @@ const getApplicationsBasedOnStatus = async (status: string, limit: number, lastD
116114
lastDoc = await ApplicationsModel.doc(lastDocId).get();
117115
}
118116

119-
// Hot-fix: Sorting by userId due to missing created field in some entries.
120-
// Revert to createdAt once the field is updated.
121-
// https://github.com/Real-Dev-Squad/website-backend/issues/2084
122-
dbQuery = dbQuery.orderBy("userId", "desc");
117+
dbQuery = dbQuery.orderBy("createdAt", "desc");
123118

124119
if (lastDoc) {
125120
dbQuery = dbQuery.startAfter(lastDoc);

0 commit comments

Comments
 (0)