Remove types

This commit is contained in:
Adria Navarro 2025-03-03 12:23:25 +01:00
parent e73126218a
commit a7e17712a3
3 changed files with 16 additions and 27 deletions

View File

@ -1,12 +1,6 @@
<script lang="ts">
import { CoreSelect, CoreMultiselect } from "@budibase/bbui"
import {
FieldType,
GroupUserDatasource,
InternalTable,
TableDatasource,
UserDatasource,
} from "@budibase/types"
import { FieldType, InternalTable } from "@budibase/types"
import { fetchData, Utils } from "@budibase/frontend-core"
import { getContext } from "svelte"
import Field from "./Field.svelte"
@ -15,9 +9,6 @@
RelationshipFieldMetadata,
Row,
} from "@budibase/types"
import TableFetch from "@budibase/frontend-core/src/fetch/TableFetch"
import UserFetch from "@budibase/frontend-core/src/fetch/UserFetch.js"
import GroupUserFetch from "@budibase/frontend-core/src/fetch/GroupUserFetch.js"
export let field: string | undefined = undefined
export let label: string | undefined = undefined
@ -29,7 +20,7 @@
export let defaultValue: string | string[] | undefined = undefined
export let onChange: any
export let filter: SearchFilter[]
export let datasourceType: "table" | "user" | "groupUser" = "table"
export let datasourceType: "table" | "user" = "table"
export let primaryDisplay: string | undefined = undefined
export let span: number | undefined = undefined
export let helpText: string | undefined = undefined
@ -114,22 +105,20 @@
dsType: typeof datasourceType,
filter: SearchFilter[],
linkedTableId?: string
): TableFetch | UserFetch | GroupUserFetch | undefined => {
) => {
if (!linkedTableId) {
return undefined
}
let datasource: TableDatasource | UserDatasource | GroupUserDatasource
if (dsType === "table") {
datasource = {
type: "table",
tableId: linkedTableId,
}
} else {
datasource = {
type: dsType,
tableId: InternalTable.USER_METADATA,
}
}
const datasource =
datasourceType === "table"
? {
type: datasourceType,
tableId: fieldSchema?.tableId!,
}
: {
type: datasourceType,
tableId: InternalTable.USER_METADATA,
}
return fetchData({
API,
datasource,

View File

@ -4,7 +4,7 @@ import { GroupUserDatasource, InternalTable } from "@budibase/types"
interface GroupUserQuery {
groupId: string
emailSearch: string
emailSearch?: string
}
interface GroupUserDefinition {

View File

@ -9,8 +9,8 @@ import {
} from "@budibase/types"
interface UserFetchQuery {
appId: string
paginated: boolean
appId?: string
paginated?: boolean
}
interface UserDefinition {