Skip to content

Commit

Permalink
fix caching
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed May 2, 2024
1 parent 9de1e9e commit 2e6abe5
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ export const useGetDataViewIdsWithTitle = () => {

return useQuery<DataViewListItem[], IHttpFetchError>(
[TRANSFORM_REACT_QUERY_KEYS.GET_DATA_VIEW_IDS_WITH_TITLE],
async () => await data.dataViews.getIdsWithTitle()
async () => {
// Since we let useQuery take care of caching,
// clear the cache to ensure we get the latest data view list.
await data.dataViews.clearCache();
return await data.dataViews.getIdsWithTitle();
}
);
};

0 comments on commit 2e6abe5

Please sign in to comment.