Fix user types
This commit is contained in:
parent
1f51489368
commit
f0d60c6063
|
@ -2,10 +2,11 @@ import { get } from "svelte/store"
|
||||||
import DataFetch from "./DataFetch.js"
|
import DataFetch from "./DataFetch.js"
|
||||||
import { TableNames } from "../constants"
|
import { TableNames } from "../constants"
|
||||||
import { utils } from "@budibase/shared-core"
|
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 }, {}> {
|
export default class UserFetch extends DataFetch<{ tableId: string }, {}> {
|
||||||
constructor(opts: { API: UIFetchAPI; datasource: Table; options?: {} }) {
|
constructor(opts: { API: APIClient; datasource: Table; options?: {} }) {
|
||||||
super({
|
super({
|
||||||
...opts,
|
...opts,
|
||||||
datasource: {
|
datasource: {
|
||||||
|
@ -40,12 +41,12 @@ export default class UserFetch extends DataFetch<{ tableId: string }, {}> {
|
||||||
const { appId, paginated, ...rest } = query || ({} as any) // TODO
|
const { appId, paginated, ...rest } = query || ({} as any) // TODO
|
||||||
const finalQuery = utils.isSupportedUserSearch(rest)
|
const finalQuery = utils.isSupportedUserSearch(rest)
|
||||||
? query
|
? query
|
||||||
: { string: { email: null } }
|
: { [BasicOperator.EMPTY]: { email: true } } // TODO: check
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const opts = {
|
const opts = {
|
||||||
bookmark: cursor,
|
bookmark: cursor ?? undefined,
|
||||||
query: finalQuery,
|
query: finalQuery ?? undefined,
|
||||||
appId: appId,
|
appId: appId,
|
||||||
paginate: paginated || paginate,
|
paginate: paginated || paginate,
|
||||||
limit,
|
limit,
|
||||||
|
|
Loading…
Reference in New Issue