Fix more fucky wucky typey wipey stuff.
This commit is contained in:
parent
5356cfdce5
commit
79b4d260f1
|
@ -11,7 +11,7 @@
|
|||
Label,
|
||||
Multiselect,
|
||||
} from "@budibase/bbui"
|
||||
import { FieldType, SearchFilterOperator } from "@budibase/types"
|
||||
import { ArrayOperator, FieldType } from "@budibase/types"
|
||||
import { generate } from "shortid"
|
||||
import { QueryUtils, Constants } from "@budibase/frontend-core"
|
||||
import { getContext } from "svelte"
|
||||
|
@ -268,7 +268,7 @@
|
|||
<slot name="binding" {filter} />
|
||||
{:else if [FieldType.STRING, FieldType.LONGFORM, FieldType.NUMBER, FieldType.BIGINT, FieldType.FORMULA].includes(filter.type)}
|
||||
<Input disabled={filter.noValue} bind:value={filter.value} />
|
||||
{:else if filter.type === FieldType.ARRAY || (filter.type === FieldType.OPTIONS && filter.operator === SearchFilterOperator.ONE_OF)}
|
||||
{:else if filter.type === FieldType.ARRAY || (filter.type === FieldType.OPTIONS && filter.operator === ArrayOperator.ONE_OF)}
|
||||
<Multiselect
|
||||
disabled={filter.noValue}
|
||||
options={getFieldOptions(filter.field)}
|
||||
|
|
|
@ -337,14 +337,15 @@ export function fixupFilterArrays(filters: SearchFilters) {
|
|||
}
|
||||
|
||||
for (const key of Object.keys(field)) {
|
||||
if (!Array.isArray(field[key])) {
|
||||
if (typeof field[key] === "string") {
|
||||
field[key] = (field[key] as string)
|
||||
.split(",")
|
||||
.map((x: string) => x.trim())
|
||||
} else {
|
||||
field[key] = [field[key]]
|
||||
if (Array.isArray(field[key])) {
|
||||
continue
|
||||
}
|
||||
|
||||
const value = field[key] as any
|
||||
if (typeof value === "string") {
|
||||
field[key] = value.split(",").map((x: string) => x.trim())
|
||||
} else {
|
||||
field[key] = [value]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue