From 2043fd3402f12abe55f9b7701ffa20009dec6e1f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 17 Dec 2021 18:48:44 +0000 Subject: [PATCH] Fix issue with determining view schema --- packages/client/src/utils/fetch/DataFetch.js | 5 ++--- packages/client/src/utils/fetch/ViewFetch.js | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/client/src/utils/fetch/DataFetch.js b/packages/client/src/utils/fetch/DataFetch.js index 1238bd8fcd..97e394dd8c 100644 --- a/packages/client/src/utils/fetch/DataFetch.js +++ b/packages/client/src/utils/fetch/DataFetch.js @@ -166,7 +166,7 @@ export default class DataFetch { */ async getPage() { const { sortColumn, sortOrder, sortType, limit } = this.options - const { query, pageNumber } = get(this.store) + const { query } = get(this.store) // Get the actual data let { rows, info, hasNextPage, cursor } = await this.getData() @@ -183,8 +183,7 @@ export default class DataFetch { // If we don't support pagination, do a client-side limit if (!this.supportsPagination) { - rows = rows.slice(pageNumber * limit, (pageNumber + 1) * limit) - // rows = luceneLimit(rows, limit) + rows = luceneLimit(rows, limit) } return { diff --git a/packages/client/src/utils/fetch/ViewFetch.js b/packages/client/src/utils/fetch/ViewFetch.js index 639cbf9450..523d8901e0 100644 --- a/packages/client/src/utils/fetch/ViewFetch.js +++ b/packages/client/src/utils/fetch/ViewFetch.js @@ -2,16 +2,13 @@ import DataFetch from "./DataFetch.js" import { fetchViewData } from "api" export default class ViewFetch extends DataFetch { - static async getSchema(datasource, definition) { - const schema = definition?.views?.[datasource.name]?.schema - console.log(schema) - return schema + static getSchema(datasource, definition) { + return definition?.views?.[datasource.name]?.schema } async getData() { const { datasource } = this.options const res = await fetchViewData(datasource) - console.log(res) return { rows: res || [], }