Browse Source

fix: sort order in shared grid view

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/679/head
Pranav C 3 years ago
parent
commit
37beb6feb1
  1. 10
      packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

10
packages/nocodb/src/lib/noco/meta/NcMetaMgrEE.ts

@ -173,8 +173,14 @@ export default class NcMetaMgrEE extends NcMetaMgr {
if (queryParams.where) {
where += where ? `~and(${queryParams.where})` : queryParams.where;
}
if (queryParams.sort) {
sort.push(...queryParams.sort.split(','));
if (queryParams.sortList) {
sort.push(
...(queryParams?.sortList
?.map(sort => {
return sort.field ? `${sort.order}${sort.field}` : '';
})
.filter(Boolean) || [])
);
}
if (req.query.sort) {

Loading…
Cancel
Save