From abb98be274aa937a0051febda01f733b47d1d38d Mon Sep 17 00:00:00 2001 From: Minki Date: Tue, 11 Nov 2025 20:15:10 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=A7=80=EC=9B=90=20=EC=9A=94=EC=B2=AD?= =?UTF-8?q?=20=EB=B0=8F=20=EB=82=B4=EA=B0=80=20=EC=A7=80=EC=9B=90=ED=95=9C?= =?UTF-8?q?=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20api=20=EC=83=9D?= =?UTF-8?q?=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/applicants.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/api/applicants.ts b/src/api/applicants.ts index eedb4fa..cb70779 100644 --- a/src/api/applicants.ts +++ b/src/api/applicants.ts @@ -1,9 +1,12 @@ import axios from './axiosInstance'; import { + PROJECT_ME_URL, PROJECTS_APPLICATION_URL, + PROJECTS_APPLY_URL, PROJECTS_APPROVAL_URL, PROJECTS_REJECT_URL, } from '../constants/endpoint'; +import axiosInstance from './axiosInstance'; export type UserProfile = { id: string; @@ -50,7 +53,6 @@ export function normalizeApplicants(payload: any): UserProfile[] { : []; } - export async function getApplicants(projectId: number): Promise { const { data } = await axios.get(PROJECTS_APPLICATION_URL(projectId)); return normalizeApplicants(data?.payload); @@ -64,4 +66,16 @@ export async function approveApplicant(projectId: number, userId: string) { export async function rejectApplicant(projectId: number, userId: string) { const { data } = await axios.put(PROJECTS_REJECT_URL(projectId, userId)); return data; -} \ No newline at end of file +} + +export const postApply = async (projectId: number, position: string) => { + const { data } = await axiosInstance.post(PROJECTS_APPLY_URL(projectId), { + position, + }); + return data.payload; +}; + +export const getMyApply = async (status?: string) => { + const { data } = await axiosInstance.get(PROJECT_ME_URL, { params: status }); + return data.payload; +};