fix(profiles): delete a profile's generations instead of orphaning them

This commit is contained in:
SEPURI-SAI-KRISHNA
2026-10-04 00:19:41 +00:00
committed by capy-ai-staging[bot]
parent 4f54e16824
commit 4750b47b04
4 changed files with 243 additions and 11 deletions
+4
View File
@@ -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'] });
},
});
}