NTP-20843 | sort order fix (#1059)
This commit is contained in:
@@ -137,7 +137,7 @@ const useFirestoreUpdates = () => {
|
||||
InteractionManager.runAfterInteractions(() => {
|
||||
subscribeToCollection(
|
||||
`allocations/${refId}/cases`,
|
||||
(ref) => ref.orderBy('totalOverdueAmount', 'desc'),
|
||||
(ref) => ref.orderBy('totalOverdueAmount', 'asc'),
|
||||
handleCasesUpdate
|
||||
);
|
||||
subscribeToDoc(`filters/${refId}`, handleFilterUpdate);
|
||||
|
||||
@@ -54,12 +54,12 @@ export const updateCases = (props: UpdateCasesProps) => (dispatch: AppDispatch)
|
||||
const { caseStatus, pinRank, caseViewCreatedAt } = caseDetails?.[caseReferenceId];
|
||||
const isCaseCompleted = COMPLETED_STATUSES.includes(caseStatus);
|
||||
const caseItem = { caseReferenceId, pinRank, caseViewCreatedAt } as ICaseItem;
|
||||
updatedCasesList.push(caseItem);
|
||||
updatedCasesList.unshift(caseItem);
|
||||
isCaseCompleted
|
||||
? completedList.push(caseItem)
|
||||
? completedList.unshift(caseItem)
|
||||
: pinRank
|
||||
? pinnedList.push(caseItem)
|
||||
: pendingList.push(caseItem);
|
||||
? pinnedList.unshift(caseItem)
|
||||
: pendingList.unshift(caseItem);
|
||||
});
|
||||
return { pendingList, completedList, pinnedList, updatedCasesList };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user