Fix curl placeholder url depending on base_module.

Fix currencies wrapper url variable name.
This commit is contained in:
Miguel Medeiros 2021-09-03 16:02:05 -03:00
parent 5977e96034
commit ba0fb996d2
No known key found for this signature in database
GPG Key ID: 819EDEE4673F3EBB
2 changed files with 15 additions and 9 deletions

View File

@ -44,7 +44,7 @@
<ng-template ngbPanelContent> <ng-template ngbPanelContent>
<div class="endpoint"> <div class="endpoint">
<div class="subtitle" i18n="Api docs endpoint">Endpoint</div> <div class="subtitle" i18n="Api docs endpoint">Endpoint</div>
<a [href]="wrapUrl(network.val, code.assets)" target="_blank">GET {{ baseNetworkUrl }}/api/currencies</a> <a [href]="wrapUrl(network.val, code.marketsCurrencies)" target="_blank">GET {{ baseNetworkUrl }}/api/currencies</a>
</div> </div>
<div class="description"> <div class="description">
<div class="subtitle" i18n>Description</div> <div class="subtitle" i18n>Description</div>

View File

@ -272,17 +272,23 @@ yarn add @mempool/liquid.js`;
const indexNumber = index + 1; const indexNumber = index + 1;
text = text.replace('%{' + indexNumber + '}', textReplace); text = text.replace('%{' + indexNumber + '}', textReplace);
} }
if (this.network === 'main' || this.network === '') {
if (this.method === 'post') { if (this.env.BASE_MODULE === 'mempool') {
return `curl POST -sSLd ${text}`; 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') { if (this.env.BASE_MODULE !== 'mempool') {
text = text.replace('/api', `/${this.network}/api`); return `curl -sSL "${this.hostname}${text}"`;
return `curl POST -sSLd ${text}`;
} }
return `curl -sSL ${this.hostname}/${this.network}${text}`;
} }
} }