From b6cbccd112e396550d4dfe19200d9cf778a6df9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=87=E1=85=A1=E1=86=A8=E1=84=80=E1=85=A5=E1=86=AB?= =?UTF-8?q?=E1=84=80=E1=85=B2?= Date: Thu, 19 Sep 2024 17:23:45 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=ED=95=A9=EB=B6=88=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EB=B3=80=EA=B2=BD=20=EC=9A=94=EC=B2=AD=20mathod?= =?UTF-8?q?=EA=B0=80=20=EC=98=AC=EB=B0=94=EB=A5=B4=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EC=95=98=EB=8D=98=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #221 --- frontend/components/passState/ApplicantsList.tsx | 10 +++++----- frontend/src/apis/passState/index.tsx | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/frontend/components/passState/ApplicantsList.tsx b/frontend/components/passState/ApplicantsList.tsx index 183af24..c9e98e5 100644 --- a/frontend/components/passState/ApplicantsList.tsx +++ b/frontend/components/passState/ApplicantsList.tsx @@ -2,7 +2,7 @@ import { getAllApplicantsWithPassState, - postApplicantPassState, + patchApplicantPassState, } from "@/src/apis/passState"; import { CURRENT_GENERATION } from "@/src/constants"; import { usePathname } from "next/navigation"; @@ -10,7 +10,7 @@ import Txt from "../common/Txt.component"; import { getApplicantPassState } from "@/src/functions/formatter"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import type { - PostApplicantPassStateParams, + PatchApplicantPassStateParams, Answer, } from "@/src/apis/passState"; @@ -57,8 +57,8 @@ const ApplicantsList = ({ sortedBy }: ApplicantsListProps) => { ); const { mutate: updateApplicantPassState } = useMutation({ - mutationFn: (params: PostApplicantPassStateParams) => - postApplicantPassState(params), + mutationFn: (params: PatchApplicantPassStateParams) => + patchApplicantPassState(params), onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["allApplicantsWithPassState", selectedGeneration], @@ -86,7 +86,7 @@ const ApplicantsList = ({ sortedBy }: ApplicantsListProps) => { const onChangeApplicantsPassState = ( applicantName: string, - params: PostApplicantPassStateParams + params: PatchApplicantPassStateParams ) => { const ok = confirm( `${applicantName}님을 ${params.afterState} 처리하시겠습니까?` diff --git a/frontend/src/apis/passState/index.tsx b/frontend/src/apis/passState/index.tsx index dd7e2f1..9375d43 100644 --- a/frontend/src/apis/passState/index.tsx +++ b/frontend/src/apis/passState/index.tsx @@ -22,15 +22,15 @@ export const getAllApplicantsWithPassState = async (generation: string) => { return data; }; -export interface PostApplicantPassStateParams { - applicantsId: string; +export interface PatchApplicantPassStateParams { + applicantId: string; afterState: "non-pass" | "pass"; } -export const postApplicantPassState = async ({ +export const patchApplicantPassState = async ({ afterState, - applicantsId, -}: PostApplicantPassStateParams) => { - await https.post( - `/applicants/${applicantsId}/state?afterState=${afterState}` + applicantId, +}: PatchApplicantPassStateParams) => { + await https.patch( + `/applicants/${applicantId}/state?afterState=${afterState}` ); }; From 6f503e4d7b4ac6c840b713dfe1408d1b2a5f0f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=87=E1=85=A1=E1=86=A8=E1=84=80=E1=85=A5=E1=86=AB?= =?UTF-8?q?=E1=84=80=E1=85=B2?= Date: Thu, 19 Sep 2024 17:29:57 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=EC=98=A4=ED=83=80=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EB=B0=8F=20=EB=B9=8C=EB=93=9C=20=EC=97=90=EB=9F=AC?= =?UTF-8?q?=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #221 --- frontend/components/passState/ApplicantsList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/components/passState/ApplicantsList.tsx b/frontend/components/passState/ApplicantsList.tsx index c9e98e5..af5d01e 100644 --- a/frontend/components/passState/ApplicantsList.tsx +++ b/frontend/components/passState/ApplicantsList.tsx @@ -132,7 +132,7 @@ const ApplicantsList = ({ sortedBy }: ApplicantsListProps) => { className="border px-4 py-2 rounded-lg truncate hover:bg-primary-100" onClick={() => onChangeApplicantsPassState(name, { - applicantsId: id, + applicantId: id, afterState: "pass", }) } @@ -143,7 +143,7 @@ const ApplicantsList = ({ sortedBy }: ApplicantsListProps) => { className="border px-4 rounded-lg truncate hover:bg-primary-100" onClick={() => onChangeApplicantsPassState(name, { - applicantsId: id, + applicantId: id, afterState: "non-pass", }) }