feat(assist): fixed double sort

This commit is contained in:
Taha Yassine Kraiem 2022-07-15 17:37:32 +02:00
parent 6df525e258
commit 8d1e1795a7

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);