Skip to content

Commit

Permalink
fix: 합불 상태 변경 요청 mathod가 올바르지 않았던 버그 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
geongyu09 committed Sep 19, 2024
1 parent c5e1bd7 commit b6cbccd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions frontend/components/passState/ApplicantsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import {
getAllApplicantsWithPassState,
postApplicantPassState,
patchApplicantPassState,
} from "@/src/apis/passState";
import { CURRENT_GENERATION } from "@/src/constants";
import { usePathname } from "next/navigation";
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";

Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -86,7 +86,7 @@ const ApplicantsList = ({ sortedBy }: ApplicantsListProps) => {

const onChangeApplicantsPassState = (
applicantName: string,
params: PostApplicantPassStateParams
params: PatchApplicantPassStateParams
) => {
const ok = confirm(
`${applicantName}님을 ${params.afterState} 처리하시겠습니까?`
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/apis/passState/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
);
};

0 comments on commit b6cbccd

Please sign in to comment.