mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Unify Data Table pagination (no-changelog) (#19467)
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import type { ListDataStoreContentQueryDto, DataTableFilter } from '@n8n/api-types';
|
import { ListDataStoreContentQueryDto, DataTableFilter } from '@n8n/api-types';
|
||||||
import { CreateTable, DslColumn } from '@n8n/db';
|
import { CreateTable, DslColumn } from '@n8n/db';
|
||||||
import { Service } from '@n8n/di';
|
import { Service } from '@n8n/di';
|
||||||
import {
|
import {
|
||||||
@@ -549,7 +549,7 @@ export class DataStoreRowsRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private applyPagination(query: QueryBuilder, dto: ListDataStoreContentQueryDto): void {
|
private applyPagination(query: QueryBuilder, dto: ListDataStoreContentQueryDto): void {
|
||||||
query.skip(dto.skip);
|
query.skip(dto.skip ?? 0);
|
||||||
query.take(dto.take);
|
if (dto.take) query.take(dto.take);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,9 +211,7 @@ export class DataStoreRepository extends Repository<DataTable> {
|
|||||||
options: Partial<ListDataStoreQueryDto>,
|
options: Partial<ListDataStoreQueryDto>,
|
||||||
): void {
|
): void {
|
||||||
query.skip(options.skip ?? 0);
|
query.skip(options.skip ?? 0);
|
||||||
if (options?.take) {
|
if (query.take) query.take(options.take);
|
||||||
query.skip(options.skip ?? 0).take(options.take);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private applyDefaultSelect(query: SelectQueryBuilder<DataTable>): void {
|
private applyDefaultSelect(query: SelectQueryBuilder<DataTable>): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user