Skip to content
Snippets Groups Projects
Commit 0276cd20 authored by D4rkHeart's avatar D4rkHeart
Browse files

[Refactor] Make `customSort()` pure

parent 513e0a14
No related branches found
No related tags found
1 merge request!20Sorting by birth date not working
......@@ -225,11 +225,11 @@ export default {
return dateify(a) - dateify(b);
};
let compareFunction;
if (column === 'applicant_birthdate') {
compareFunction = compareByDate;
} else {
compareFunction = compareAlphabetically;
const compareFunction = pickCompareFunction(column);
function pickCompareFunction (column) {
if (column === 'applicant_birthdate') return compareByDate;
return compareAlphabetically;
}
const compareFunctionReversed = function(a, b) { return - compareFunction(a, b); };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment