From ad1538fa3a976c57827bff78bea2fb32d5dba77d Mon Sep 17 00:00:00 2001 From: Igor Zalutski Date: Fri, 6 Sep 2024 17:04:13 +0100 Subject: [PATCH] Rename mutation --- .../(specific-project-pages)/TriggerApplyButton.tsx | 4 ++-- src/data/user/projects.tsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/(specific-project-pages)/TriggerApplyButton.tsx b/src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/(specific-project-pages)/TriggerApplyButton.tsx index ecfa0639..ac41ca3e 100644 --- a/src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/(specific-project-pages)/TriggerApplyButton.tsx +++ b/src/app/(dynamic-pages)/(authenticated-pages)/(application-pages)/project/[projectSlug]/(specific-project-pages)/TriggerApplyButton.tsx @@ -6,7 +6,7 @@ import { useSAToastMutation } from "@/hooks/useSAToastMutation"; export function TriggerApplyButton({ projectId }: { projectId: string }) { - const updateProjectSettingsMutation = useSAToastMutation( + const triggerApplyMutation = useSAToastMutation( async () => { const result = await triggerApplyAction({ projectId: projectId, @@ -22,7 +22,7 @@ export function TriggerApplyButton({ projectId }: { projectId: string }) { const onClick = async () => { try { - await updateProjectSettingsMutation.mutateAsync(); + await triggerApplyMutation.mutateAsync(); } catch (error) { console.error("Error updating project settings:", error); } diff --git a/src/data/user/projects.tsx b/src/data/user/projects.tsx index fa27b381..86bb7256 100644 --- a/src/data/user/projects.tsx +++ b/src/data/user/projects.tsx @@ -970,8 +970,8 @@ export async function triggerApplyAction({ projectId }: { projectId: string }): const user = await serverGetLoggedInUser(); const payload = { - userId: user.id, - projectId + user_id: user.id, + project_id: projectId, } const response = await fetch( triggerApplyUrl,