diff --git a/packages/frontend-core/src/fetch/UserFetch.js b/packages/frontend-core/src/fetch/UserFetch.ts similarity index 77% rename from packages/frontend-core/src/fetch/UserFetch.js rename to packages/frontend-core/src/fetch/UserFetch.ts index 36f61542b5..730d96ebd5 100644 --- a/packages/frontend-core/src/fetch/UserFetch.js +++ b/packages/frontend-core/src/fetch/UserFetch.ts @@ -2,9 +2,10 @@ import { get } from "svelte/store" import DataFetch from "./DataFetch.js" import { TableNames } from "../constants" import { utils } from "@budibase/shared-core" +import { Table, UIFetchAPI } from "@budibase/types" -export default class UserFetch extends DataFetch { - constructor(opts) { +export default class UserFetch extends DataFetch<{ tableId: string }, {}> { + constructor(opts: { API: UIFetchAPI; datasource: Table; options?: {} }) { super({ ...opts, datasource: { @@ -27,12 +28,16 @@ export default class UserFetch extends DataFetch { } } + getSchema(_datasource: any, definition: Table | null) { + return definition?.schema + } + async getData() { const { limit, paginate } = this.options const { cursor, query } = get(this.store) // Convert old format to new one - we now allow use of the lucene format - const { appId, paginated, ...rest } = query || {} + const { appId, paginated, ...rest } = query || ({} as any) // TODO const finalQuery = utils.isSupportedUserSearch(rest) ? query : { string: { email: null } }