FIX: Nimbus URL Strategy

This commit is contained in:
Victor Radael
2022-05-16 12:04:13 -03:00
parent a8a429977f
commit 09c7cc79ee
4 changed files with 27 additions and 9271 deletions
+6 -9
View File
@@ -2,15 +2,12 @@ import axios from 'axios';
class CatalogService {
async catalogAll(body) {
const customer =
body.info.customer.toLowerCase() === 'dadosfera'
? ``
: `-${body.info.customer.toLowerCase()}`;
const nimbusUrl =
process.env.ENV === 'prd'
? `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`
: `${process.env.NIMBUS_BASE_URL}${customer}.${process.env.ENV}.dadosfera`;
let nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.dadosfera.ai`;
if (process.env.ENV !== 'prd') {
nimbusUrl = `https://nimbus-${body.info.customer.toLowerCase()}.${
process.env.ENV
}.dadosfera.ai`;
}
const { data } = await axios.get(`${nimbusUrl}/api/catalog/all/`);