code7-leia 0.2.22 → 0.2.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1230,6 +1230,10 @@ var url = 'https://api.leia.digitalcontact.cloud';
1230
1230
  axios.defaults.baseURL = "" + url;
1231
1231
  var api = /*#__PURE__*/axios.create();
1232
1232
 
1233
+ var url$1 = 'http://localhost:5000';
1234
+ axios.defaults.baseURL = "" + url$1;
1235
+ var apiHml = /*#__PURE__*/axios.create();
1236
+
1233
1237
  var _excluded$5 = ["children"];
1234
1238
  var SharedPropsContext = /*#__PURE__*/React.createContext(undefined);
1235
1239
  var useSharedProps = function useSharedProps() {
@@ -1243,7 +1247,8 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
1243
1247
  var children = _ref.children,
1244
1248
  props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1245
1249
  var id = props.id,
1246
- language = props.language;
1250
+ language = props.language,
1251
+ env = props.env;
1247
1252
  var _useState = React.useState(null),
1248
1253
  tags = _useState[0],
1249
1254
  setTags = _useState[1];
@@ -1253,68 +1258,94 @@ var SharedPropsProvider = function SharedPropsProvider(_ref) {
1253
1258
  React.useEffect(function () {
1254
1259
  var fetchData = /*#__PURE__*/function () {
1255
1260
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
1256
- var _yield$api$get, data;
1261
+ var _ref3, data;
1257
1262
  return _regeneratorRuntime().wrap(function _callee$(_context) {
1258
1263
  while (1) switch (_context.prev = _context.next) {
1259
1264
  case 0:
1260
1265
  _context.prev = 0;
1261
- _context.next = 3;
1266
+ if (!(env.toLowerCase() === 'prod')) {
1267
+ _context.next = 7;
1268
+ break;
1269
+ }
1270
+ _context.next = 4;
1262
1271
  return api.get("/tags/" + id);
1263
- case 3:
1264
- _yield$api$get = _context.sent;
1265
- data = _yield$api$get.data;
1272
+ case 4:
1273
+ _context.t0 = _context.sent;
1274
+ _context.next = 10;
1275
+ break;
1276
+ case 7:
1277
+ _context.next = 9;
1278
+ return apiHml.get("/tags/" + id);
1279
+ case 9:
1280
+ _context.t0 = _context.sent;
1281
+ case 10:
1282
+ _ref3 = _context.t0;
1283
+ data = _ref3.data;
1266
1284
  if (data) {
1267
1285
  setTags(data);
1268
1286
  } else {
1269
1287
  console.error('Erro ao fazer a solicitação');
1270
1288
  }
1271
- _context.next = 11;
1289
+ _context.next = 18;
1272
1290
  break;
1273
- case 8:
1274
- _context.prev = 8;
1275
- _context.t0 = _context["catch"](0);
1276
- console.error('Erro ao fazer a solicitação:', _context.t0);
1277
- case 11:
1291
+ case 15:
1292
+ _context.prev = 15;
1293
+ _context.t1 = _context["catch"](0);
1294
+ console.error('Erro ao fazer a solicitação:', _context.t1);
1295
+ case 18:
1278
1296
  case "end":
1279
1297
  return _context.stop();
1280
1298
  }
1281
- }, _callee, null, [[0, 8]]);
1299
+ }, _callee, null, [[0, 15]]);
1282
1300
  }));
1283
1301
  return function fetchData() {
1284
1302
  return _ref2.apply(this, arguments);
1285
1303
  };
1286
1304
  }();
1287
1305
  var personas = /*#__PURE__*/function () {
1288
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1289
- var _yield$api$get2, data;
1306
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
1307
+ var _ref5, data;
1290
1308
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
1291
1309
  while (1) switch (_context2.prev = _context2.next) {
1292
1310
  case 0:
1293
1311
  _context2.prev = 0;
1294
- _context2.next = 3;
1312
+ if (!(env.toLowerCase() === 'prod')) {
1313
+ _context2.next = 7;
1314
+ break;
1315
+ }
1316
+ _context2.next = 4;
1295
1317
  return api.get("/personas?language=" + language);
1296
- case 3:
1297
- _yield$api$get2 = _context2.sent;
1298
- data = _yield$api$get2.data;
1318
+ case 4:
1319
+ _context2.t0 = _context2.sent;
1320
+ _context2.next = 10;
1321
+ break;
1322
+ case 7:
1323
+ _context2.next = 9;
1324
+ return apiHml.get("/personas?language=" + language);
1325
+ case 9:
1326
+ _context2.t0 = _context2.sent;
1327
+ case 10:
1328
+ _ref5 = _context2.t0;
1329
+ data = _ref5.data;
1299
1330
  if (data) {
1300
1331
  setPersonas(data);
1301
1332
  } else {
1302
1333
  console.error('Erro ao fazer a solicitação');
1303
1334
  }
1304
- _context2.next = 11;
1335
+ _context2.next = 18;
1305
1336
  break;
1306
- case 8:
1307
- _context2.prev = 8;
1308
- _context2.t0 = _context2["catch"](0);
1309
- console.error('Erro ao fazer a solicitação:', _context2.t0);
1310
- case 11:
1337
+ case 15:
1338
+ _context2.prev = 15;
1339
+ _context2.t1 = _context2["catch"](0);
1340
+ console.error('Erro ao fazer a solicitação:', _context2.t1);
1341
+ case 18:
1311
1342
  case "end":
1312
1343
  return _context2.stop();
1313
1344
  }
1314
- }, _callee2, null, [[0, 8]]);
1345
+ }, _callee2, null, [[0, 15]]);
1315
1346
  }));
1316
1347
  return function personas() {
1317
- return _ref3.apply(this, arguments);
1348
+ return _ref4.apply(this, arguments);
1318
1349
  };
1319
1350
  }();
1320
1351
  fetchData();
@@ -2106,10 +2137,6 @@ function filesReducer(state, action) {
2106
2137
  });
2107
2138
  }
2108
2139
 
2109
- var url$1 = 'http://localhost:5000';
2110
- axios.defaults.baseURL = "" + url$1;
2111
- var apiHml = /*#__PURE__*/axios.create();
2112
-
2113
2140
  var CustomToastContent = function CustomToastContent(_ref) {
2114
2141
  var title = _ref.title,
2115
2142
  description = _ref.description;