mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-04 01:25:18 -07:00
fix(profiles): delete a profile's generations instead of orphaning them
This commit is contained in:
committed by
capy-ai-staging[bot]
parent
4f54e16824
commit
4750b47b04
@@ -51,6 +51,10 @@ export function useDeleteProfile() {
|
||||
mutationFn: (profileId: string) => apiClient.deleteProfile(profileId),
|
||||
onSuccess: () => {
|
||||
queryClient.invalidateQueries({ queryKey: ['profiles'] });
|
||||
// Deleting a profile also deletes its generations, which story items
|
||||
// reference — both caches still hold rows that no longer exist.
|
||||
queryClient.invalidateQueries({ queryKey: ['history'] });
|
||||
queryClient.invalidateQueries({ queryKey: ['stories'] });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user