Skip to content

Commit 638ee0b

Browse files
authored
Merge pull request #201 from CSE-Shaco/develop
fix(manito): csv 업로드 문제 해결
2 parents 714065f + 45b403f commit 638ee0b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/app/manitto/admin/page.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ export default function ManitoAdminPage() {
7171

7272
try {
7373
setLoadingSessions(true);
74-
const res = await apiClient.post('/admin/manito/sessions', {code, title});
75-
const created = res.data?.data;
74+
await apiClient.post('/admin/manito/sessions', {code, title});
7675

7776
// 세션 목록 갱신
7877
await fetchSessions();

src/hooks/useAuthenticatedApi.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,18 @@ export const useAuthenticatedApi = () => {
4646

4747
// 요청 인터셉터
4848
client.interceptors.request.use((config) => {
49-
if (!config.headers['Content-Type']) {
49+
// FormData인지 체크
50+
const isFormData = typeof FormData !== 'undefined' && config.data instanceof FormData;
51+
if (!isFormData && !config.headers['Content-Type']) {
5052
config.headers['Content-Type'] = 'application/json';
5153
}
5254

5355
if (accessTokenRef.current) {
5456
config.headers.Authorization = `Bearer ${accessTokenRef.current}`;
5557
}
58+
5659
return config;
57-
}, (error) => Promise.reject(error));
60+
}, (error) => Promise.reject(error),);
5861

5962
// 응답 인터셉터
6063
client.interceptors.response.use((response) => response, async (error) => {

0 commit comments

Comments
 (0)