File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ if (!API_V3_HOST) {
1010const adService = {
1111 async getBannerTypeAdList ( writerUsername : string ) {
1212 const GET_AD_LIST = `
13- query ads {
14- ads(input: {writer_username: " ${ writerUsername } ", limit: 2, type: "banner" } ) {
13+ query ads($input: AdsInput!) {
14+ ads(input: $input ) {
1515 id
1616 title
1717 body
@@ -21,13 +21,21 @@ const adService = {
2121 }
2222 ` ;
2323
24- const endpoint = getEndpoint ( ) ;
24+ const variables = {
25+ input : {
26+ writer_username : writerUsername ,
27+ limit : 2 ,
28+ type : 'banner' ,
29+ } ,
30+ } ;
2531
32+ const endpoint = getEndpoint ( ) ;
2633 const { data } = await Axios . post < AxiosResponse < GetAdListResponse > > (
2734 endpoint ,
2835 {
2936 operationName : 'ads' ,
3037 query : GET_AD_LIST ,
38+ variables,
3139 } ,
3240 {
3341 headers : {
You can’t perform that action at this time.
0 commit comments