Patching some bugs.

This commit is contained in:
charles-gauthereau
2025-01-03 15:55:16 +01:00
parent be47e9e93d
commit b59a010425
6 changed files with 24 additions and 10 deletions
@@ -16,10 +16,14 @@ export const ButtonDeleteProject = (props: ButtonDeleteProjectProps) => {
const router = useRouter()
const mutation = useMutation({
mutationFn: () => deleteProjectAction(props.projectId),
onSuccess: async (result) => {
router.push("/dashboard")
if(result.data.success) {
onSuccess: async (result: any) => {
console.log(result)
if(result.data?.success) {
toast.success(result.data.actionSuccess.message);
router.push("/")
}else{
toast.error(result.data.actionError.message || "Unknown error occurred.");
}
},
})