From ba0fb996d2adf4d583c7754b57bedb05f7781fa9 Mon Sep 17 00:00:00 2001 From: Miguel Medeiros Date: Fri, 3 Sep 2021 16:02:05 -0300 Subject: [PATCH] Fix curl placeholder url depending on base_module. Fix currencies wrapper url variable name. --- .../api-docs/api-docs.component.html | 2 +- .../api-docs/code-template.component.ts | 22 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/frontend/src/app/components/api-docs/api-docs.component.html b/frontend/src/app/components/api-docs/api-docs.component.html index 29a8ab95d..70e80bfc7 100644 --- a/frontend/src/app/components/api-docs/api-docs.component.html +++ b/frontend/src/app/components/api-docs/api-docs.component.html @@ -44,7 +44,7 @@
Description
diff --git a/frontend/src/app/components/api-docs/code-template.component.ts b/frontend/src/app/components/api-docs/code-template.component.ts index 40b207520..396a22b77 100644 --- a/frontend/src/app/components/api-docs/code-template.component.ts +++ b/frontend/src/app/components/api-docs/code-template.component.ts @@ -272,17 +272,23 @@ yarn add @mempool/liquid.js`; const indexNumber = index + 1; text = text.replace('%{' + indexNumber + '}', textReplace); } - if (this.network === 'main' || this.network === '') { - if (this.method === 'post') { - return `curl POST -sSLd ${text}`; + + if (this.env.BASE_MODULE === 'mempool') { + if (this.network === 'main' || this.network === '') { + if (this.method === 'post') { + return `curl POST -sSLd "${text}"`; + } + return `curl -sSL "${this.hostname}${text}"`; } - return `curl -sSL ${this.hostname}${text}`; + if (this.method === 'post') { + text = text.replace('/api', `/${this.network}/api`); + return `curl POST -sSLd "${text}"`; + } + return `curl -sSL "${this.hostname}/${this.network}${text}"`; } - if (this.method === 'post') { - text = text.replace('/api', `/${this.network}/api`); - return `curl POST -sSLd ${text}`; + if (this.env.BASE_MODULE !== 'mempool') { + return `curl -sSL "${this.hostname}${text}"`; } - return `curl -sSL ${this.hostname}/${this.network}${text}`; } }