@@ -30,23 +30,23 @@ async function apiRequest<T>(
3030export const subscriptionAPI = {
3131 // 이메일 인증 요청
3232 requestEmailVerification : async ( email : string ) => {
33- return apiRequest ( '/emails/verifications' , {
33+ return apiRequest ( '/api/ emails/verifications' , {
3434 method : 'POST' ,
3535 body : JSON . stringify ( { email } ) ,
3636 } ) ;
3737 } ,
3838
3939 // 인증 코드 확인
4040 verifyCode : async ( email : string , code : string ) => {
41- return apiRequest ( '/emails/verifications/verify' , {
41+ return apiRequest ( '/api/ emails/verifications/verify' , {
4242 method : 'POST' ,
4343 body : JSON . stringify ( { email, code } ) ,
4444 } ) ;
4545 } ,
4646
4747 // 이메일 중복 체크
4848 checkEmail : async ( email : string ) => {
49- return apiRequest ( `/subscriptions/email/check?email=${ encodeURIComponent ( email ) } ` , {
49+ return apiRequest ( `/api/ subscriptions/email/check?email=${ encodeURIComponent ( email ) } ` , {
5050 method : 'GET' ,
5151 } ) ;
5252 } ,
@@ -58,7 +58,7 @@ export const subscriptionAPI = {
5858 days : string [ ] ;
5959 period : number ; // 이미 숫자로 변환된 값을 받음
6060 } ) => {
61- return apiRequest ( '/subscriptions' , {
61+ return apiRequest ( '/api/ subscriptions' , {
6262 method : 'POST' ,
6363 body : JSON . stringify ( {
6464 ...data ,
@@ -69,7 +69,7 @@ export const subscriptionAPI = {
6969
7070 // subscriptionId로 구독정보 조회
7171 getSubscriptionById : async ( subscriptionId : string ) => {
72- return apiRequest ( `/subscriptions/${ subscriptionId } ` , {
72+ return apiRequest ( `/api/ subscriptions/${ subscriptionId } ` , {
7373 method : 'GET'
7474 } ) ;
7575 } ,
@@ -82,7 +82,7 @@ export const subscriptionAPI = {
8282 period : number ;
8383 active : boolean ;
8484 } ) => {
85- return apiRequest ( `/subscriptions/${ subscriptionId } ` , {
85+ return apiRequest ( `/api/ subscriptions/${ subscriptionId } ` , {
8686 method : 'PATCH' ,
8787 body : JSON . stringify ( data ) ,
8888 } ) ;
@@ -93,7 +93,7 @@ export const subscriptionAPI = {
9393export const quizAPI = {
9494 // 퀴즈 카테고리 목록 조회
9595 getQuizCategories : async ( ) : Promise < string [ ] | { data : string [ ] } > => {
96- return apiRequest ( '/quiz-categories' , {
96+ return apiRequest ( '/api/ quiz-categories' , {
9797 method : 'GET'
9898 } ) ;
9999 } ,
@@ -104,23 +104,23 @@ export const quizAPI = {
104104 if ( subscriptionId ) params . append ( 'subscriptionId' , subscriptionId ) ;
105105 if ( quizId ) params . append ( 'quizId' , quizId ) ;
106106
107- const endpoint = params . toString ( ) ? `/todayQuiz?${ params . toString ( ) } ` : '/todayQuiz' ;
107+ const endpoint = params . toString ( ) ? `/api/ todayQuiz?${ params . toString ( ) } ` : '/todayQuiz' ;
108108 return apiRequest ( endpoint , {
109109 method : 'GET'
110110 } ) ;
111111 } ,
112112
113113 // 퀴즈 답안 제출
114114 submitQuizAnswer : async ( quizId : string , answer : number ) => {
115- return apiRequest ( '/quiz/submit' , {
115+ return apiRequest ( '/api/ quiz/submit' , {
116116 method : 'POST' ,
117117 body : JSON . stringify ( { quizId, answer } ) ,
118118 } ) ;
119119 } ,
120120
121121 // TodayQuiz 답안 제출
122122 submitTodayQuizAnswer : async ( quizId : string , answer : number | string , subscriptionId : string ) => {
123- return apiRequest ( `/quizzes/${ quizId } ` , {
123+ return apiRequest ( `/api/ quizzes/${ quizId } ` , {
124124 method : 'POST' ,
125125 body : JSON . stringify ( {
126126 answer : answer . toString ( ) ,
@@ -131,21 +131,21 @@ export const quizAPI = {
131131
132132 // 사용자별 퀴즈 히스토리
133133 getUserQuizHistory : async ( email : string , token : string ) => {
134- return apiRequest ( `/quiz/history?email=${ email } &token=${ token } ` , {
134+ return apiRequest ( `/api/ quiz/history?email=${ email } &token=${ token } ` , {
135135 method : 'GET'
136136 } ) ;
137137 } ,
138138
139139 // 퀴즈 선택 비율 조회
140140 getQuizSelectionRates : async ( quizId : string ) => {
141- return apiRequest ( `/quizzes/${ quizId } /select-rate` , {
141+ return apiRequest ( `/api/ quizzes/${ quizId } /select-rate` , {
142142 method : 'GET'
143143 } ) ;
144144 } ,
145145
146146 // AI 피드백 조회 (주관식)
147147 getAiFeedback : async ( answerId : string ) => {
148- return apiRequest ( `/quizzes/${ answerId } /feedback` , {
148+ return apiRequest ( `/api/ quizzes/${ answerId } /feedback` , {
149149 method : 'GET'
150150 } ) ;
151151 } ,
@@ -155,28 +155,28 @@ export const quizAPI = {
155155export const userAPI = {
156156 // 사용자 프로필 조회
157157 getProfile : async ( ) => {
158- return apiRequest ( '/profile' , {
158+ return apiRequest ( '/api/ profile' , {
159159 method : 'GET'
160160 } ) ;
161161 } ,
162162
163163 // 사용자 구독 정보 조회
164164 getProfileSubscription : async ( ) => {
165- return apiRequest ( '/profile/subscription' , {
165+ return apiRequest ( '/api/ profile/subscription' , {
166166 method : 'GET'
167167 } ) ;
168168 } ,
169169
170170 // 사용자 틀린 문제 조회
171171 getWrongQuiz : async ( ) => {
172- return apiRequest ( '/profile/wrong-quiz' , {
172+ return apiRequest ( '/api/ profile/wrong-quiz' , {
173173 method : 'GET'
174174 } ) ;
175175 } ,
176176
177177 // 사용자 카테고리별 정답률 조회
178178 getCorrectRate : async ( ) => {
179- return apiRequest ( '/profile/correct-rate' , {
179+ return apiRequest ( '/api/ profile/correct-rate' , {
180180 method : 'GET'
181181 } ) ;
182182 } ,
@@ -187,46 +187,46 @@ export const userAPI = {
187187export const authAPI = {
188188 // 로그인
189189 login : async ( email : string , password : string ) => {
190- return apiRequest ( '/auth/login' , {
190+ return apiRequest ( '/api/ auth/login' , {
191191 method : 'POST' ,
192192 body : JSON . stringify ( { email, password } ) ,
193193 } ) ;
194194 } ,
195195
196196 // 회원가입
197197 register : async ( email : string , password : string ) => {
198- return apiRequest ( '/auth/register' , {
198+ return apiRequest ( '/api/ auth/register' , {
199199 method : 'POST' ,
200200 body : JSON . stringify ( { email, password } ) ,
201201 } ) ;
202202 } ,
203203
204204 // 토큰 갱신 (기존 - 호환성용)
205205 refreshToken : async ( refreshToken : string ) => {
206- return apiRequest ( '/auth/refresh' , {
206+ return apiRequest ( '/api/ auth/refresh' , {
207207 method : 'POST' ,
208208 body : JSON . stringify ( { refreshToken } ) ,
209209 } ) ;
210210 } ,
211211
212212 // 토큰 재발급 (HttpOnly 쿠키 기반)
213213 reissueToken : async ( reissueRequestDto : any ) => {
214- return apiRequest ( '/auth/reissue' , {
214+ return apiRequest ( '/api/ auth/reissue' , {
215215 method : 'POST' ,
216216 body : JSON . stringify ( reissueRequestDto ) ,
217217 } ) ;
218218 } ,
219219
220220 // 로그아웃
221221 logout : async ( ) => {
222- return apiRequest ( '/auth/logout' , {
222+ return apiRequest ( '/api/ auth/logout' , {
223223 method : 'POST' ,
224224 } ) ;
225225 } ,
226226
227227 // 인증 상태 확인 (HttpOnly 쿠키 기반)
228228 checkAuthStatus : async ( ) => {
229- return apiRequest ( '/auth/status' , {
229+ return apiRequest ( '/api/ auth/status' , {
230230 method : 'GET' ,
231231 } ) ;
232232 } ,
0 commit comments