Skip to content

Commit

Permalink
Adds filters to fetch data trigger of dataview
Browse files Browse the repository at this point in the history
Co-authored-by: Marccc <marc@protofy.xyz>
  • Loading branch information
mikecmart and marcprotofy committed Jul 5, 2024
1 parent e55d715 commit 1c2e998
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/protolib/components/DataView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ const DataViewInternal = forwardRef(({
const [currentItemData, setCurrentItemData] = useState(itemData)
const { search, setSearch, setSearchName } = useContext(SearchContext)
const hasGlobalMenu = extraMenuActions && extraMenuActions.some(action => action.menus && action.menus.includes("global"));
const filters = Object.entries(state).filter((st) => st[0].startsWith('filter'))

useQueryState(setState)

Expand Down Expand Up @@ -216,7 +217,7 @@ const DataViewInternal = forwardRef(({

useUpdateEffect(() => {
fetch(setItems)
}, [state.orderBy + '_' + state.itemsPerPage + '_' + state.page + '_' + state.search + '_' + state.orderDirection])
}, [state.orderBy + '_' + state.itemsPerPage + '_' + state.page + '_' + state.search + '_' + state.orderDirection + '_' + filters])

const toast = useToastController()
const RowIcon = rowIcon
Expand Down

0 comments on commit 1c2e998

Please sign in to comment.