Browse Source

fix(api): by default set primary key as the sort column

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3007/head
Pranav C 2 years ago
parent
commit
c7bdf7b903
  1. 2
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

2
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -1332,7 +1332,7 @@ class BaseModelSqlv2 {
);
obj.offset = Math.max(+(args.offset || args.o) || 0, 0);
obj.fields = args.fields || args.f || '*';
obj.sort = args.sort || args.s || this.model.primaryKey?.[0]?.tn;
obj.sort = args.sort || args.s || this.model.primaryKey?.title;
return obj;
}

Loading…
Cancel
Save