@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.
- package/core/esm2020/lib/services/api-requester/koala.api-requester.base.mjs +11 -5
- package/core/fesm2015/koalarx-ui-core.mjs +10 -4
- package/core/fesm2015/koalarx-ui-core.mjs.map +1 -1
- package/core/fesm2020/koalarx-ui-core.mjs +10 -4
- package/core/fesm2020/koalarx-ui-core.mjs.map +1 -1
- package/core/lib/services/api-requester/koala.api-requester.base.d.ts +4 -2
- package/package.json +1 -1
|
@@ -1281,10 +1281,10 @@ class KoalaApiRequesterCache {
|
|
|
1281
1281
|
KoalaApiRequesterCache.cache = [];
|
|
1282
1282
|
|
|
1283
1283
|
class KoalaApiRequesterBase {
|
|
1284
|
-
constructor(koalaService, endpoint,
|
|
1284
|
+
constructor(koalaService, endpoint, statusCache = false, environmentNameToEndpointApi = 'endpointApi', isMockup = false) {
|
|
1285
1285
|
this.koalaService = koalaService;
|
|
1286
1286
|
this.endpoint = endpoint;
|
|
1287
|
-
this.
|
|
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.
|
|
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.
|
|
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 {
|