mirror of
https://github.com/n8n-io/n8n.git
synced 2026-05-28 07:17:04 +02:00
fix(core): Unify Data Table pagination (no-changelog) (#19467)
This commit is contained in:
parent
a4dff23d92
commit
26f27efd75
|
|
@ -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 { Service } from '@n8n/di';
|
||||
import {
|
||||
|
|
@ -549,7 +549,7 @@ export class DataStoreRowsRepository {
|
|||
}
|
||||
|
||||
private applyPagination(query: QueryBuilder, dto: ListDataStoreContentQueryDto): void {
|
||||
query.skip(dto.skip);
|
||||
query.take(dto.take);
|
||||
query.skip(dto.skip ?? 0);
|
||||
if (dto.take) query.take(dto.take);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -211,9 +211,7 @@ export class DataStoreRepository extends Repository<DataTable> {
|
|||
options: Partial<ListDataStoreQueryDto>,
|
||||
): void {
|
||||
query.skip(options.skip ?? 0);
|
||||
if (options?.take) {
|
||||
query.skip(options.skip ?? 0).take(options.take);
|
||||
}
|
||||
if (query.take) query.take(options.take);
|
||||
}
|
||||
|
||||
private applyDefaultSelect(query: SelectQueryBuilder<DataTable>): void {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user