Skip to content

Commit

Permalink
fix: id search on the map view
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviareichl committed Oct 14, 2024
1 parent 73a48aa commit 941e942
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/data-map-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const searchFiltersSchema = v.object({
search: v.fallback(v.string(), ""),
});
const idCategories = ["entityID", "typeID", "valueTypeID", "typeIDWithSubs"];
const entitySelectionSchema = v.object({
selection: v.fallback(v.array(v.string()), []),
});
Expand Down Expand Up @@ -58,11 +60,13 @@ const { data, isPending, isPlaceholderData } = useGetSearchResults(
computed(() => {
const { search, category, ...params } = searchFilters.value;
const operator = idCategories.includes(category) ? "equal" : "like";
return {
...params,
search:
search.length > 0
? [{ [category]: [{ operator: "like", values: [search], logicalOperator: "and" }] }]
? [{ [category]: [{ operator: operator, values: [search], logicalOperator: "and" }] }]
: [],
show: ["geometry", "when"],
centroid: true,
Expand Down

0 comments on commit 941e942

Please sign in to comment.