File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 11import apiConfig from "../config/apiConfig" ;
22import { Application } from "../types/application" ;
33
4+ interface ApiResponse < T > {
5+ status : number ;
6+ message : string ;
7+ data : T ;
8+ }
9+
410export const fetchApplications = async ( track ?: string ) : Promise < Application [ ] > => {
511 try {
6- const response = await apiConfig . get < Application [ ] > ( "/admin/apply" , {
12+ const response = await apiConfig . get < ApiResponse < Application [ ] > > ( "/admin/apply" , {
713 headers : {
814 Authorization : `Bearer ${ localStorage . getItem ( "accessToken" ) } ` ,
915 Accept : "application/json" ,
1016 } ,
1117 params : track ? { track } : { } ,
1218 } ) ;
1319
14- return response . data . data ; // data 속성 내부 배열만 반환하는 것으로 수정했는데 'Application[]' 형식에 'data' 속성이 없다는 오류 발생.
20+ return response . data . data ;
1521 } catch ( error : any ) {
1622 throw new Error ( error . response ?. data ?. message || "지원서 목록 조회 실패" ) ;
1723 }
1824} ;
19-
You can’t perform that action at this time.
0 commit comments