Merge pull request #616

v1.7.0 hotfix
This commit is contained in:
Kraiem Taha Yassine 2022-07-15 17:38:33 +02:00 committed by GitHub
commit 01af0c75a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,6 +162,9 @@ const sortPaginate = function (list, filters) {
const tB = getValue(b, "timestamp");
return tA > tB ? 1 : tA < tB ? -1 : 0;
});
if (filters.sort.order) {
list.reverse();
}
if ((filters.sort.key || "timestamp") !== "timestamp") {
list.sort((a, b) => {
const vA = getValue(a, filters.sort.key);