File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -3,24 +3,19 @@ import { IContents } from '../../interfaces/IContents'
33import { IApiContents } from '../../interfaces/api/IApiContents'
44import { API_SERVER } from '../../data/constants/config' ;
55
6- type GetSponsorDataProps = 'prospectus' | 'sporsor-benefit' | 'sponsor-join' | 'sponsor-faq' | 'terms-of-sponsor' ;
6+ type SponsorDataEndPointType = 'prospectus' | 'sporsor-benefit' | 'sponsor-join' | 'sponsor-faq' | 'terms-of-sponsor' ;
77
8- export const getSponsorData = async ( endPoint : GetSponsorDataProps ) : Promise < IContents > => {
9- try {
10- const response = await axios . get (
11- `${ API_SERVER } /content/${ endPoint } `
12- )
13- const data : IApiContents = response . data
8+ export const getSponsorData = async ( endPoint : SponsorDataEndPointType ) : Promise < IContents > => {
9+ const response = await axios . get (
10+ `${ API_SERVER } /content/${ endPoint } `
11+ ) ;
12+ const data : IApiContents = response . data ;
1413
15- return {
16- content : {
17- ko : data . content ,
18- en : data . eng_content
19- }
14+ return {
15+ content : {
16+ ko : data . content ,
17+ en : data . eng_content
2018 }
21- } catch ( error ) {
22- window ?. alert ( '일시적인 오류가 발생하였습니다. 잠시 후 다시 시도해 주세요.' )
2319 }
24-
2520}
2621
You can’t perform that action at this time.
0 commit comments