Browse Source

refactor: add error in response if offset if beyond the limit

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5901/head
Pranav C 1 year ago
parent
commit
fc44f64672
  1. 8
      packages/nocodb/src/helpers/PagedResponse.ts

8
packages/nocodb/src/helpers/PagedResponse.ts

@ -30,6 +30,14 @@ export class PagedResponseImpl<T> {
this.pageInfo.page === this.pageInfo.page ===
(Math.ceil(this.pageInfo.totalRows / this.pageInfo.pageSize) || 1); (Math.ceil(this.pageInfo.totalRows / this.pageInfo.pageSize) || 1);
} }
if (offset && offset >= count) {
this.errors = [
{
message: 'Offset is beyond the total number of rows',
},
];
}
} }
list: Array<T>; list: Array<T>;

Loading…
Cancel
Save