URL custom-окружение обрабатывается теперь также как testing

This commit is contained in:
kuduzow
2023-01-05 22:32:53 +03:00
parent afb57769f6
commit 03a1eb4a49
2 changed files with 6 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@orionprotocol/sdk",
"version": "0.15.27-rc.3",
"version": "0.15.27-rc.4",
"description": "Orion Protocol SDK",
"main": "./lib/esm/index.js",
"module": "./lib/esm/index.js",

View File

@@ -33,13 +33,13 @@ class ReferralSystem {
// testing.orionprotocol.io/referral-api вместо обычного
// testing.orionprotocol.io/bsc-testnet/referral-api, поэтому лишняя часть вырезается
static getActualApiUrl = (apiUrl: string, env: string) => {
if (env !== 'testing') {
return `${apiUrl}/referral-api`;
if (env === 'testing' || env === 'custom') {
const { protocol, hostname } = new URL(apiUrl);
return `${protocol}//${hostname}/referral-api`;
}
const { protocol, hostname } = new URL(apiUrl);
return `${protocol}//${hostname}/referral-api`;
return `${apiUrl}/referral-api`;
};
getLink = (refererAddress: string) => fetchWithValidation(`${this.apiUrl}/referer/view/link`, linkSchema, {