Browse Source

fix(nc-gui): data apis v2 skip pagination

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
01ebd0f891
  1. 1
      packages/nocodb/src/controllers/data-table.controller.ts
  2. 4
      packages/nocodb/src/services/data-table.service.ts

1
packages/nocodb/src/controllers/data-table.controller.ts

@ -38,6 +38,7 @@ export class DataTableController {
query: req.query, query: req.query,
modelId: modelId, modelId: modelId,
viewId: viewId, viewId: viewId,
ignorePagination: req.headers?.['xc-ignore-pagination'] === 'true',
}); });
const elapsedSeconds = parseHrtimeToMilliSeconds(process.hrtime(startTime)); const elapsedSeconds = parseHrtimeToMilliSeconds(process.hrtime(startTime));
res.setHeader('xc-db-response', elapsedSeconds); res.setHeader('xc-db-response', elapsedSeconds);

4
packages/nocodb/src/services/data-table.service.ts

@ -3,11 +3,11 @@ import { isLinksOrLTAR, RelationTypes } from 'nocodb-sdk';
import { nocoExecute } from 'nc-help'; import { nocoExecute } from 'nc-help';
import { validatePayload } from 'src/helpers'; import { validatePayload } from 'src/helpers';
import type { LinkToAnotherRecordColumn } from '~/models'; import type { LinkToAnotherRecordColumn } from '~/models';
import { Column, Model, Source, View } from '~/models';
import { DatasService } from '~/services/datas.service'; import { DatasService } from '~/services/datas.service';
import { NcError } from '~/helpers/catchError'; import { NcError } from '~/helpers/catchError';
import getAst from '~/helpers/getAst'; import getAst from '~/helpers/getAst';
import { PagedResponseImpl } from '~/helpers/PagedResponse'; import { PagedResponseImpl } from '~/helpers/PagedResponse';
import { Column, Model, Source, View } from '~/models';
import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2'; import NcConnectionMgrv2 from '~/utils/common/NcConnectionMgrv2';
@Injectable() @Injectable()
@ -19,6 +19,7 @@ export class DataTableService {
modelId: string; modelId: string;
query: any; query: any;
viewId?: string; viewId?: string;
ignorePagination?: boolean;
}) { }) {
const { model, view } = await this.getModelAndView(param); const { model, view } = await this.getModelAndView(param);
@ -27,6 +28,7 @@ export class DataTableService {
view, view,
query: param.query, query: param.query,
throwErrorIfInvalidParams: true, throwErrorIfInvalidParams: true,
ignorePagination: param.ignorePagination,
}); });
} }

Loading…
Cancel
Save