fix: add cascade delete for card-related foreign keys and invalidate … (#31)
* fix: add cascade delete for card-related foreign keys and invalidate workspace cache after deletion * fix: use refetch instead of invalidate for workspace deletion to ensure immediate UI update * feat: add cascade delete to card relations and activity tables
This commit is contained in:
@@ -15,14 +15,19 @@ export function DeleteWorkspaceConfirmation() {
|
||||
|
||||
const [isAcknowledgmentChecked, setIsAcknowledgmentChecked] = useState(false);
|
||||
|
||||
const utils = api.useUtils();
|
||||
|
||||
const deleteWorkspaceMutation = api.workspace.delete.useMutation({
|
||||
onSuccess: () => {
|
||||
onSuccess: async () => {
|
||||
closeModal();
|
||||
showPopup({
|
||||
header: "Workspace deleted",
|
||||
message: "Your workspace has been deleted.",
|
||||
icon: "success",
|
||||
});
|
||||
|
||||
await utils.workspace.all.refetch();
|
||||
|
||||
const filteredWorkspaces = availableWorkspaces.filter(
|
||||
(ws) => ws.publicId !== workspace.publicId,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user