From 6539f90b51c618ec1cbcf0ea78797f6a623cb2f7 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 17 Dec 2021 18:53:57 +0000 Subject: [PATCH] Update query fetch to support new pagination structure --- packages/client/src/utils/fetch/QueryFetch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/client/src/utils/fetch/QueryFetch.js b/packages/client/src/utils/fetch/QueryFetch.js index 097fff1250..52fce4135a 100644 --- a/packages/client/src/utils/fetch/QueryFetch.js +++ b/packages/client/src/utils/fetch/QueryFetch.js @@ -5,7 +5,7 @@ import { get } from "svelte/store" export default class QueryFetch extends DataFetch { determineFeatureFlags(definition) { - console.log("pagination config", definition?.pagination) + console.log("pagination config", definition?.fields?.pagination) this.supportsPagination = definition?.fields?.pagination?.type != null && definition?.fields?.pagination?.pageParam != null @@ -33,7 +33,7 @@ export default class QueryFetch extends DataFetch { let queryPayload = { queryId: datasource?._id, parameters } if (this.supportsPagination) { const { cursor, definition, pageNumber } = get(this.store) - const { type } = definition.fields.pagination.type + const { type } = definition.fields.pagination const page = type === "page" ? pageNumber : cursor queryPayload.pagination = { page, limit } }