Skip to content

Commit

Permalink
Feat: #208 프로젝트 목록 데이터 타입 변환 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Seok93 committed Oct 12, 2024
1 parent 7114f4e commit ecb0416
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/services/projectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ export async function findUserByProject(
* @returns {Promise<AxiosResponse<Project[]>>}
*/
export async function getProjectList(teamId: Team['teamId'], axiosConfig: AxiosRequestConfig = {}) {
return authAxios.get<Project[]>(`/team/${teamId}/project`, axiosConfig);
return authAxios.get<Project[]>(`/team/${teamId}/project`, {
transformResponse: (data) => {
const parsedData: Project[] = JSON.parse(data);
return parsedData.map((data) => {
data.startDate = data.startDate && new Date(data.startDate);
data.endDate = data.endDate && new Date(data.endDate);
return data;
});
},
...axiosConfig,
});
}

/**
Expand Down

0 comments on commit ecb0416

Please sign in to comment.