Skip to content

Commit 0ba150c

Browse files
committed
Merge branch 'fix/graphql-query' into feature/turnstile
2 parents 7ae46f7 + 30fbeb1 commit 0ba150c

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/services/adService.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ if (!API_V3_HOST) {
1010
const 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: {

0 commit comments

Comments
 (0)