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

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

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

Loading…
Cancel
Save