Skip to content

Commit d5d7570

Browse files
committed
Fix for sorting certain fields
1 parent 6f56697 commit d5d7570

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/services/ChallengeService.js

+12
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,18 @@ async function searchChallenges(currentUser, criteria) {
457457
}
458458

459459
let sortByProp = criteria.sortBy ? criteria.sortBy : "created";
460+
461+
// Add '.keyword' to the end of the sort by prop for certain fields
462+
// (TOP-2364)
463+
if(sortByProp === "updatedBy" ||
464+
sortByProp === "createdBy" ||
465+
sortByProp === "name" ||
466+
sortByProp === "type" ||
467+
sortByProp === "status") {
468+
469+
sortByProp = sortByProp + ".keyword";
470+
}
471+
460472
const sortOrderProp = criteria.sortOrder ? criteria.sortOrder : "desc";
461473

462474
const mustQuery = [];

0 commit comments

Comments
 (0)