mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 11:12:35 +02:00
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.