1
0
Fork 0
mirror of synced 2024-10-03 10:36:59 +13:00

Fix issue with determining view schema

This commit is contained in:
Andrew Kingston 2021-12-17 18:48:44 +00:00
parent 441cc2fccf
commit 2043fd3402
2 changed files with 4 additions and 8 deletions

View file

@ -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 {

View file

@ -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 || [],
}