Sort logs in descending order
parent
e258bf8432
commit
6b26c1cb5c
|
@ -124,9 +124,10 @@ function getLogsWithUrlByUserId(userId) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return Promise.all(urlPromises).then(infos => {
|
return Promise.all(urlPromises).then(infos => {
|
||||||
|
// Sort logs by date, in descending order
|
||||||
infos.sort((a, b) => {
|
infos.sort((a, b) => {
|
||||||
if (a.date > b.date) return 1;
|
if (a.date > b.date) return -1;
|
||||||
if (a.date < b.date) return -1;
|
if (a.date < b.date) return 1;
|
||||||
return 0;
|
return 0;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue