Browse Source

fix: check view/id defined or not before getting sort list based on viewId

pull/6941/head
Pranav C 1 year ago
parent
commit
2792f68eaa
  1. 11
      packages/nocodb/src/db/BaseModelSqlv2.ts

11
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -657,10 +657,13 @@ class BaseModelSqlv2 {
qb, qb,
); );
if (!sorts) if (!sorts) {
sorts = args.sortArr?.length if (args.sortArr?.length) {
? args.sortArr sorts = args.sortArr;
: await Sort.list({ viewId: this.viewId }); } else if (this.viewId) {
sorts = await Sort.list({ viewId: this.viewId });
}
}
// if sort is provided filter out the group by columns sort and apply // if sort is provided filter out the group by columns sort and apply
// since we are grouping by the column and applying sort on any other column is not required // since we are grouping by the column and applying sort on any other column is not required

Loading…
Cancel
Save