Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 57a09d2

Browse files
committed
Fixed: sorting wasn't loaded correctly from URL.
1 parent b6025a7 commit 57a09d2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/constants/workPeriods/sortBy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ export const START_DATE = "START_DATE";
44
export const END_DATE = "END_DATE";
55
export const ALERT = "ALERT";
66
export const WEEKLY_RATE = "WEEKLY_RATE";
7-
export const PAYMENT_STATUS = "STATUS";
8-
export const PAYMENT_TOTAL = "TOTAL_PAYMENT";
7+
export const PAYMENT_STATUS = "PAYMENT_STATUS";
8+
export const PAYMENT_TOTAL = "PAYMENT_TOTAL";
99
export const WORKING_DAYS = "WORKING_DAYS";

src/store/reducers/workPeriods.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -739,8 +739,9 @@ function updateStateFromQuery(queryStr, state) {
739739
updateSorting = true;
740740
}
741741
// checking sorting order
742-
if (params.order in SORT_ORDER && params.order !== sorting.order) {
743-
sorting.order = params.order;
742+
const order = params.order;
743+
if (order && order.toUpperCase() in SORT_ORDER && order !== sorting.order) {
744+
sorting.order = order;
744745
updateSorting = true;
745746
}
746747
// checking page number

0 commit comments

Comments
 (0)