Skip to content

Commit

Permalink
fix: filters: reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
ssiyad committed Nov 23, 2023
1 parent 2352631 commit 91695ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions desk/src/components/FilterPopover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<div id="fieldname" class="!min-w-[140px]">
<Autocomplete
:value="f.field.fieldname"
:options="fields"
:options="fields.data"
placeholder="Filter by..."
@change="(e) => updateFilter(e, i)"
/>
Expand Down Expand Up @@ -67,7 +67,7 @@
<div class="flex items-center justify-between gap-2">
<Autocomplete
value=""
:options="fields"
:options="fields.data"
placeholder="Filter by..."
@change="(e) => setfilter(e)"
>
Expand Down
3 changes: 3 additions & 0 deletions desk/src/components/SearchComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const r = createListResource({
pageLength: props.pageLength,
auto: true,
fields: [props.labelField, props.searchField, props.valueField],
filters: {
[props.searchField]: ["like", `%${props.value}%`],
},
onSuccess: () => {
selection.value = props.value
? options.value.find((o) => o.value === props.value)
Expand Down
2 changes: 1 addition & 1 deletion desk/src/composables/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function useFilter(doctype: string) {
return {
add,
apply,
fields: fields.data,
fields,
getArgs,
storage,
};
Expand Down

0 comments on commit 91695ec

Please sign in to comment.