mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 10:15:04 +02:00
fix(settings): deleted API key stays on screen until manual reload
The delete-API-key mutation called queryClient.invalidateQueries on the ['api-keys'] cache, which in react-query v5 should also refetch active queries — but in practice the deleted row remained visible until the user reloaded the page. Switched onSuccess to setQueryData so the deleted key is filtered out of the cache synchronously the moment the API confirms; no refetch round-trip required, no invalidation→refetch race possible. Create-path is unchanged (invalidateQueries was working there). Pins the contract with a new SettingsPage test that mocks the GET/DELETE endpoints, clicks delete, confirms, and asserts the row is gone without any reload.
This commit is contained in:
File diff suppressed because one or more lines are too long
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
<!-- Splash screens for iOS -->
|
||||
<link rel="apple-touch-startup-image" href="/img/android-chrome-512x512.png" />
|
||||
<script type="module" crossorigin src="/assets/index-JRaF_JhW.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-DRS5LiBG.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-telVPl_h.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user