redux-toolkit
redux-toolkit copied to clipboard
Invalidates Tags Not Working
Hey, I am using openapi to genetate the api endpoints. After the file is generated, I made changes to add the tagTypes, ProvideTags, and InvalidatesTags so deal with the caching.
I am using enhanceEndpoint to add the tag type, and then used provideTags where I am fetching the details of the user and using invalidatesTags while fetching the list of users.
Let me tell you how is the workflow. First I fetch the list of user (so using /list/users/ api) which has invalidatesTags value of 'refund', and then when you click on the user, it is supposed to call /get/user api, which has providesTags.
Ideally, this should now fetch fresh data instead of serving data from the disk-cache, but this is still fetching data from the disk cache. I am confused what I am doing wrong.