Fix user types

This commit is contained in:
Adria Navarro 2025-01-02 15:55:50 +01:00
parent 1f51489368
commit f0d60c6063
1 changed files with 6 additions and 5 deletions

View File

@ -2,10 +2,11 @@ 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"
import { BasicOperator, SearchUsersRequest, Table } from "@budibase/types"
import { APIClient } from "../api/types.js"
export default class UserFetch extends DataFetch<{ tableId: string }, {}> {
constructor(opts: { API: UIFetchAPI; datasource: Table; options?: {} }) {
constructor(opts: { API: APIClient; datasource: Table; options?: {} }) {
super({
...opts,
datasource: {
@ -40,12 +41,12 @@ export default class UserFetch extends DataFetch<{ tableId: string }, {}> {
const { appId, paginated, ...rest } = query || ({} as any) // TODO
const finalQuery = utils.isSupportedUserSearch(rest)
? query
: { string: { email: null } }
: { [BasicOperator.EMPTY]: { email: true } } // TODO: check
try {
const opts = {
bookmark: cursor,
query: finalQuery,
bookmark: cursor ?? undefined,
query: finalQuery ?? undefined,
appId: appId,
paginate: paginated || paginate,
limit,