Skip to content

Commit 8762294

Browse files
fix: remove order by status, make title undefined for overdue task (#1738)
Co-authored-by: Vinit khandal <[email protected]>
1 parent 262fedd commit 8762294

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

models/tasks.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,13 @@ const fetchPaginatedTasks = async ({
176176
initialQuery = initialQuery
177177
.where("endsOn", "<", currentTime)
178178
.where("status", "in", OVERDUE_TASK_STATUSES)
179-
.orderBy("endsOn")
180-
.orderBy("status");
179+
.orderBy("endsOn");
180+
/**
181+
* Setting it undefined because when OVERDUE condition is applied, where 2 inEquality checks are being made
182+
* firestore don't allow more inEquality checks, so for title where 2 more inEquality checks are being added,
183+
* it will give error
184+
*/
185+
title = undefined;
181186
} else if (status) {
182187
initialQuery = initialQuery.where("status", "==", status);
183188
}

0 commit comments

Comments
 (0)