From 35671cb120d54eeba7c0ff371e20f3a9afe9ea84 Mon Sep 17 00:00:00 2001 From: Hwansoo Date: Fri, 28 Jan 2022 01:31:10 +0900 Subject: [PATCH 1/2] Fix not showing pagination of query on production --- packages/client/src/utils/fetch/QueryFetch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/client/src/utils/fetch/QueryFetch.js b/packages/client/src/utils/fetch/QueryFetch.js index f9052886f3..06f86dee5b 100644 --- a/packages/client/src/utils/fetch/QueryFetch.js +++ b/packages/client/src/utils/fetch/QueryFetch.js @@ -16,7 +16,10 @@ export default class QueryFetch extends DataFetch { if (!datasource?._id) { return null } - return await fetchQueryDefinition(datasource._id) + const definition = await fetchQueryDefinition(datasource._id) + // After getting the definition of query, it loses "fields" attribute because of security reason from the server. However, this attribute needs to be inside of defintion for pagination. + definition.fields = datasource.fields + return definition } async getData() { From 241d04ed38c7a4633e69deec30e316d32bdb2cfd Mon Sep 17 00:00:00 2001 From: Hwansoo Date: Tue, 1 Feb 2022 00:03:25 +0900 Subject: [PATCH 2/2] fix: check if fields exists --- packages/client/src/utils/fetch/QueryFetch.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/client/src/utils/fetch/QueryFetch.js b/packages/client/src/utils/fetch/QueryFetch.js index 06f86dee5b..76aca2a855 100644 --- a/packages/client/src/utils/fetch/QueryFetch.js +++ b/packages/client/src/utils/fetch/QueryFetch.js @@ -18,7 +18,9 @@ export default class QueryFetch extends DataFetch { } const definition = await fetchQueryDefinition(datasource._id) // After getting the definition of query, it loses "fields" attribute because of security reason from the server. However, this attribute needs to be inside of defintion for pagination. - definition.fields = datasource.fields + if (!definition.fields) { + definition.fields = datasource.fields + } return definition }