Skip to content

Commit fde2ab3

Browse files
committed
chore : 봉사 api 요청 url 콘솔 추가
봉사 api 요청 url을 콘솔에 출력하여 디버깅 용이성을 높임 - api 요청 url을 로그로 출력하여 요청 경로를 쉽게 확인 - 환경 변수 REACT_APP_BASE_URL 콘솔 추가
1 parent f0ef9f7 commit fde2ab3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/apis/volunteers/index.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,30 @@ const router = '/volunteers';
55

66
// 봉사 활동 신청
77
export const applicationVolunteer = async (volunteerId: string) => {
8-
await instance.post(`${router}/application/${volunteerId}`);
8+
const url = `${router}/application/${volunteerId}`;
9+
console.log(`Requesting POST: ${url}`);
10+
await instance.post(url);
911
}
1012

1113
// 봉사 활동 신청 취소
1214
export const deleteApplicationVolunteer = async (volunteerId: string) => {
13-
await instance.delete(`${router}/cancellation/${volunteerId}`)
15+
const url = `${router}/cancellation/${volunteerId}`;
16+
console.log(`Requesting DELETE: ${url}`);
17+
await instance.delete(url)
1418
}
1519

1620
// 봉사 활동 조회
1721
export const getVolunteer = async () => {
18-
const {data} = await instance.get<getVolunteerResponse>(`${router}`);
22+
const url = `${router}`;
23+
console.log(`Requesting GET: ${url}`);
24+
const {data} = await instance.get<getVolunteerResponse>(url);
1925
return data;
2026
}
2127

2228
// 내 봉사 신청 내역 조회
2329
export const getMyVolunteers = async () => {
24-
const {data} = await instance.get<getMyVolunteersResponse>(`${router}/my/application`)
30+
const url = `${router}/my/application`;
31+
console.log(`Requesting GET: ${url}`);
32+
const {data} = await instance.get<getMyVolunteersResponse>(url)
2533
return data;
2634
}

src/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import App from './App';
44
import reportWebVitals from './reportWebVitals';
55
import { registerSetAuthToken } from './utils/setAuthToken';
66

7+
console.log('process.env.REACT_APP_BASE_URL:', process.env.REACT_APP_BASE_URL);
8+
79
registerSetAuthToken();
810

911
const root = ReactDOM.createRoot(

0 commit comments

Comments
 (0)