diff --git a/src/pages/users/[user].tsx b/src/pages/users/[user].tsx index 4dc7bae..00cf912 100644 --- a/src/pages/users/[user].tsx +++ b/src/pages/users/[user].tsx @@ -49,6 +49,7 @@ export default User; function UserWorkspaces() { const { data: userWorkspaces, isLoading } = api.workspaceDbState.getUserWorkspaces.useQuery(); + const utils = api.useUtils(); const { setWorkspacePath, initNodes, initEdges, updateStateSnapshot } = useStoreActions(); @@ -80,7 +81,8 @@ function UserWorkspaces() { ); const { mutate: deleteWorkspace } = api.ssh.rmWorkspace.useMutation({ - onSuccess: () => { + onSuccess: async () => { + await utils.workspaceDbState.getUserWorkspaces.invalidate(); toast.success('Workspace deleted'); }, onError: () => {