use order by

This commit is contained in:
Barış Soner Uşaklı
2023-05-07 23:48:09 -04:00
parent 77b05b73a8
commit 2cdc454f3e
2 changed files with 1 additions and 7 deletions

View File

@@ -492,12 +492,6 @@ SELECT "_key" k,
FROM UNNEST($1::TEXT[]) "_key";`,
values: [keys],
});
// TODO: move this sort into nodebb_get_sorted_set_members_withscores?
res.rows.forEach((r) => {
if (r && r.m) {
r.m.sort((a, b) => a.score - b.score);
}
});
return keys.map(k => (res.rows.find(r => r.k === k) || {}).m || []);
};