Merge pull request #11945 from Budibase/fix/filter_user_column

Fixing filtering on user column
This commit is contained in:
Adria Navarro 2023-10-02 14:54:25 +02:00 committed by GitHub
commit e9f299d153
1 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,8 @@
import RelationshipCell from "./RelationshipCell.svelte" import RelationshipCell from "./RelationshipCell.svelte"
import { FieldSubtype } from "@budibase/types" import { FieldSubtype } from "@budibase/types"
export let api
const { API } = getContext("grid") const { API } = getContext("grid")
const { subtype } = $$props.schema const { subtype } = $$props.schema
@ -17,8 +19,11 @@
throw `Search for '${subtype}' not implemented` throw `Search for '${subtype}' not implemented`
} }
// As we are overriding the search function from RelationshipCell, we want to map one shape to the expected one for the specific API
const email = Object.values(searchParams.query.string)[0]
const results = await API.searchUsers({ const results = await API.searchUsers({
...searchParams, email,
}) })
// Mapping to the expected data within RelationshipCell // Mapping to the expected data within RelationshipCell
@ -31,6 +36,7 @@
</script> </script>
<RelationshipCell <RelationshipCell
bind:api
{...$$props} {...$$props}
{schema} {schema}
{searchFunction} {searchFunction}