refactor: enable dashboard widgets query cache (#7520)

#### What type of PR is this?

/kind improvement
/area ui
/milestone 2.21.x

#### What this PR does / why we need it:

Enable query cache for dashboard widgets.

#### Does this PR introduce a user-facing change?

```release-note
None 
```
This commit is contained in:
Ryan Wang
2025-06-09 23:36:34 +08:00
committed by GitHub
parent 65d4751509
commit 63d40d4d40
3 changed files with 30 additions and 6 deletions

View File

@@ -254,6 +254,10 @@ async function handleSave() {
await queryClient.invalidateQueries({
queryKey: ["core:dashboard:widgets"],
});
await queryClient.invalidateQueries({
queryKey: ["core:dashboard:widgets:view"],
});
} catch (error) {
console.error("Failed to save dashboard widgets config", error);
} finally {