Skip to content

Commit

Permalink
fix: invalidate query cache when creating custom storage volume [WD-1…
Browse files Browse the repository at this point in the history
…3879] (#829)

## Done

- Previously we did not invalidate the query cache for custom volumes
when creating a new one. This means when a user navigate back to an
instance and try to attach the volume, they will not see the volume in
the select modal unless if they refresh the page. This PR resolves this
issue.
  • Loading branch information
mas-who authored Aug 2, 2024
2 parents 506ca85 + deffa91 commit 3381df9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/storage/forms/StorageVolumeCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ const StorageVolumeCreate: FC = () => {
void queryClient.invalidateQueries({
queryKey: [queryKeys.storage],
});
void queryClient.invalidateQueries({
queryKey: [queryKeys.customVolumes],
});
void queryClient.invalidateQueries({
queryKey: [queryKeys.projects, project],
});
Expand Down

0 comments on commit 3381df9

Please sign in to comment.