@koalarx/ui 13.2.9 → 13.2.10

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.
@@ -1281,10 +1281,10 @@ class KoalaApiRequesterCache {
1281
1281
  KoalaApiRequesterCache.cache = [];
1282
1282
 
1283
1283
  class KoalaApiRequesterBase {
1284
- constructor(koalaService, endpoint, enableCache = false, environmentNameToEndpointApi = 'endpointApi', isMockup = false) {
1284
+ constructor(koalaService, endpoint, statusCache = false, environmentNameToEndpointApi = 'endpointApi', isMockup = false) {
1285
1285
  this.koalaService = koalaService;
1286
1286
  this.endpoint = endpoint;
1287
- this.enableCache = enableCache;
1287
+ this.statusCache = statusCache;
1288
1288
  koalaService.apiUrl = KoalaEnvironment.environment?.[environmentNameToEndpointApi];
1289
1289
  koalaService.isMockup = isMockup;
1290
1290
  }
@@ -1340,7 +1340,7 @@ class KoalaApiRequesterBase {
1340
1340
  return filter ?? null;
1341
1341
  }
1342
1342
  request(method, url, data = {}) {
1343
- if (this.enableCache) {
1343
+ if (this.statusCache) {
1344
1344
  if (KoalaApiRequesterCache.hasCache(url)) {
1345
1345
  return KoalaApiRequesterCache.getCacheAsObservable(url);
1346
1346
  }
@@ -1349,11 +1349,17 @@ class KoalaApiRequesterBase {
1349
1349
  return this.koalaService
1350
1350
  .request(method, url, data)
1351
1351
  .pipe(map(response => {
1352
- if (this.enableCache)
1352
+ if (this.statusCache)
1353
1353
  KoalaApiRequesterCache.setDataInCache(url, response);
1354
1354
  return response;
1355
1355
  }));
1356
1356
  }
1357
+ enableCache() {
1358
+ this.statusCache = true;
1359
+ }
1360
+ disableCache() {
1361
+ this.statusCache = false;
1362
+ }
1357
1363
  }
1358
1364
 
1359
1365
  class KoalaRequestService {