Browse Source

fix(nocodb): ignore pagination for calendar view

pull/7611/head
DarkPhoenix2704 7 months ago
parent
commit
d1b185af2f
  1. 13
      packages/nocodb/src/services/datas.service.ts
  2. 9
      packages/nocodb/src/services/public-datas.service.ts

13
packages/nocodb/src/services/datas.service.ts

@ -1,5 +1,5 @@
import { Injectable, Logger } from '@nestjs/common';
import { isSystemColumn } from 'nocodb-sdk';
import { isSystemColumn, ViewTypes } from 'nocodb-sdk';
import * as XLSX from 'xlsx';
import papaparse from 'papaparse';
import { nocoExecute } from 'nc-help';
@ -164,6 +164,16 @@ export class DatasService {
listArgs.sortArr = JSON.parse(listArgs.sortArrJson);
} catch (e) {}
let options = {};
if (view.type === ViewTypes.CALENDAR) {
{
options = {
ignorePagination: true,
};
}
}
const [count, data] = await Promise.all([
baseModel.count(listArgs, false, param.throwErrorIfInvalidParams),
(async () => {
@ -174,6 +184,7 @@ export class DatasService {
await baseModel.list(listArgs, {
ignoreViewFilterAndSort,
throwErrorIfInvalidParams: param.throwErrorIfInvalidParams,
...options,
}),
{},
listArgs,

9
packages/nocodb/src/services/public-datas.service.ts

@ -74,10 +74,17 @@ export class PublicDatasService {
let data = [];
let count = 0;
let option = {};
if (view.type === ViewTypes.CALENDAR) {
option = {
ignorePagination: true,
};
}
try {
data = await nocoExecute(
ast,
await baseModel.list(listArgs),
await baseModel.list(listArgs, option),
{},
listArgs,
);

Loading…
Cancel
Save