ntk-cms-api 1.2.236 → 1.2.237

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.
@@ -1679,10 +1679,14 @@ class ApiCmsServerBase extends ApiServerBase {
1679
1679
  const serviceName = 'ServiceGetOneById';
1680
1680
  const serviceNameKay = serviceName + '_' + id;
1681
1681
  if (this.getModuleCashService().includes(serviceName)) {
1682
- do {
1683
- if (this.cachApiResult[serviceNameKay]?.isSuccess && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds)
1682
+ if (this.cachApiResult[serviceNameKay]?.isSuccess && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds)
1683
+ return of(this.cachApiResult[serviceNameKay]);
1684
+ else
1685
+ this.cachApiResult[serviceNameKay] = null;
1686
+ while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds) {
1687
+ if (this.cachApiResult[serviceNameKay]?.isSuccess)
1684
1688
  return of(this.cachApiResult[serviceNameKay]);
1685
- } while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds);
1689
+ }
1686
1690
  this.cachApiCallDate[serviceNameKay] = new Date();
1687
1691
  }
1688
1692
  //! optimaze call api
@@ -2140,14 +2144,24 @@ class CoreEnumService extends ApiServerBase {
2140
2144
  getModuleControllerUrl() {
2141
2145
  return 'CoreEnum';
2142
2146
  }
2147
+ getModuleCashService() {
2148
+ return ['ServiceRecordStatusEnum'];
2149
+ }
2143
2150
  ServiceRecordStatusEnum() {
2144
2151
  //! optimaze call api
2145
2152
  const serviceName = 'ServiceRecordStatusEnum';
2146
- do {
2147
- if (this.cachApiResult[serviceName]?.isSuccess)
2148
- return of(this.cachApiResult[serviceName]);
2149
- } while (this.cachApiCallDate[serviceName] && (new Date().getTime() - this.cachApiCallDate[serviceName].getTime()) < this.cashApiSeconds);
2150
- this.cachApiCallDate[serviceName] = new Date();
2153
+ const serviceNameKay = serviceName;
2154
+ if (this.getModuleCashService().includes(serviceName)) {
2155
+ if (this.cachApiResult[serviceNameKay]?.isSuccess && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds)
2156
+ return of(this.cachApiResult[serviceNameKay]);
2157
+ else
2158
+ this.cachApiResult[serviceNameKay] = null;
2159
+ while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds) {
2160
+ if (this.cachApiResult[serviceNameKay]?.isSuccess)
2161
+ return of(this.cachApiResult[serviceNameKay]);
2162
+ }
2163
+ this.cachApiCallDate[serviceNameKay] = new Date();
2164
+ }
2151
2165
  //! optimaze call api
2152
2166
  return this.http
2153
2167
  .get(this.getBaseUrl() + this.getModuleControllerUrl() + '/RecordStatusEnum', {