-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: #101 프로젝트 상태 생성 API를 위한 React Query 기능 추가
- Loading branch information
Showing
3 changed files
with
63 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,35 @@ | ||
import { authAxios } from '@services/axiosProvider'; | ||
import type { AxiosRequestConfig } from 'axios'; | ||
import type { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import type { Project } from '@/types/ProjectType'; | ||
import type { ProjectStatus } from '@/types/ProjectStatusType'; | ||
import type { ProjectStatus, ProjectStatusForm } from '@/types/ProjectStatusType'; | ||
|
||
/** | ||
* 프로젝트 상태 목록 조회 API | ||
* | ||
* @export | ||
* @async | ||
* @param {Project['projectId']} projectId - 프로젝트 ID | ||
* @param {AxiosRequestConfig} axiosConfig - - axios 요청 옵션 설정 객체 | ||
* @param {AxiosRequestConfig} axiosConfig - axios 요청 옵션 설정 객체 | ||
* @returns {Promise<AxiosResponse<ProjectStatus[]>>} | ||
*/ | ||
export async function getStatusList(projectId: Project['projectId'], axiosConfig: AxiosRequestConfig = {}) { | ||
return authAxios.get<ProjectStatus[]>(`/project/${projectId}/status`, axiosConfig); | ||
} | ||
|
||
/** | ||
* 프로젝트 상태 생성 API | ||
* | ||
* @export | ||
* @async | ||
* @param {Project['projectId']} projectId - 프로젝트 ID | ||
* @param {ProjectStatusForm} formData - 상태 정보 객체 | ||
* @param {AxiosRequestConfig} axiosConfig - axios 요청 옵션 설정 객체 | ||
* @returns {Promise<AxiosResponse<void>>} | ||
*/ | ||
export async function createStatus( | ||
projectId: Project['projectId'], | ||
formData: ProjectStatusForm, | ||
axiosConfig: AxiosRequestConfig = {}, | ||
) { | ||
return authAxios.post(`/project/${projectId}/status`, formData, axiosConfig); | ||
} |