diff --git a/admin.conf b/admin.conf index 7b75e9c..6c2ce58 100644 --- a/admin.conf +++ b/admin.conf @@ -115,7 +115,7 @@ server { proxy_pass http://10.8.0.8:59303/; } - location /customer/ { + location /customer/v1.0.1/ { if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin $http_origin always; add_header Access-Control-Allow-Credentials true always; @@ -127,9 +127,40 @@ server { add_header Access-Control-Allow-Credentials true always; add_header Access-Control-Allow-Headers content-type,authorization always; add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; - proxy_pass http://10.8.0.8:8065/; + proxy_pass http://10.8.0.6:8070/; } - location /customer/v1.0.0/ { + + location /codeword/ { + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + return 200; + } + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + proxy_pass http://10.8.0.6:59664/; + } + + location /codeword/v1.0.0 { + if ($request_method = OPTIONS) { + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + return 200; + } + add_header Access-Control-Allow-Origin $http_origin always; + add_header Access-Control-Allow-Credentials true always; + add_header Access-Control-Allow-Headers content-type,authorization always; + add_header Access-Control-Allow-Methods OPTIONS,GET,POST,PATCH,PUT,DELETE; + proxy_pass http://10.8.0.6:29100/; + } + + location /answer/ { if ($request_method = OPTIONS) { add_header Access-Control-Allow-Origin $http_origin always; add_header Access-Control-Allow-Credentials true always; diff --git a/src/api/account.ts b/src/api/account.ts index c2bc0e7..45a7d58 100644 --- a/src/api/account.ts +++ b/src/api/account.ts @@ -30,7 +30,7 @@ export type Account = { wallet: Wallet; }; -const API_URL = `${process.env.REACT_APP_DOMAIN}/customer/v1.0.0`; +const API_URL = `${process.env.REACT_APP_DOMAIN}/customer/v1.0.1`; export const getAccountInfo = async (id: string): Promise<[Account | null, string?]> => { try { diff --git a/src/api/history/requests.ts b/src/api/history/requests.ts index 1e7765f..e5e59c1 100644 --- a/src/api/history/requests.ts +++ b/src/api/history/requests.ts @@ -23,7 +23,7 @@ type HistoryResponse = { totalPages: number; }; -const API_URL = `${process.env.REACT_APP_DOMAIN}/customer/v1.0.0`; +const API_URL = `${process.env.REACT_APP_DOMAIN}/customer/v1.0.1`; const getUserHistory = async (accountId: string, page: number): Promise<[HistoryResponse | null, string?]> => { try { diff --git a/src/api/quizStatistics/index.ts b/src/api/quizStatistics/index.ts index 07d3001..eb878be 100644 --- a/src/api/quizStatistics/index.ts +++ b/src/api/quizStatistics/index.ts @@ -40,7 +40,7 @@ export const getStatisticSchild = async (from: number, to: number): Promise<[Qui try { const statisticResponse = await makeRequest({ method: "POST", - url: `${API_URL}/customer/v1.0.0/quizlogo/stat`, + url: `${API_URL}/customer/v1.0.1/quizlogo/stat`, body: { to, from, page: 0, limit: 100 }, useToken: true, }); @@ -74,7 +74,7 @@ export const getStatisticsPromocode = async ( try { const statisticsPromocode = await makeRequest>({ method: "POST", - url: `${API_URL}/customer/v1.0.0/promocode/ltv`, + url: `${API_URL}/customer/v1.0.1/promocode/ltv`, body: { to, from }, useToken: true, });