ntk-cms-api 1.2.240 → 1.2.241

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.
@@ -1688,11 +1688,8 @@ class ApiCmsServerBase extends ApiServerBase {
1688
1688
  const serviceName = 'ServiceGetOneById';
1689
1689
  const serviceNameKay = serviceName + '_' + id;
1690
1690
  if (this.getModuleCashService().includes(serviceName)) {
1691
- do {
1692
- if (this.cashApiIsValid(serviceNameKay))
1693
- return of(this.cachApiResult[serviceNameKay]);
1694
- } while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds);
1695
- this.cachApiCallDate[serviceNameKay] = new Date();
1691
+ if (this.cashApiIsValid(serviceNameKay))
1692
+ return of(this.cachApiResult[serviceNameKay]);
1696
1693
  }
1697
1694
  //! optimaze call api
1698
1695
  // this.loadingStatus=true;
@@ -2159,13 +2156,8 @@ class CoreEnumService extends ApiServerBase {
2159
2156
  const serviceName = 'ServiceRecordStatusEnum';
2160
2157
  const serviceNameKay = serviceName;
2161
2158
  if (this.getModuleCashService().includes(serviceName)) {
2162
- if (this.cachApiResult[serviceNameKay]?.isSuccess)
2159
+ if (this.cashApiIsValid(serviceNameKay))
2163
2160
  return of(this.cachApiResult[serviceNameKay]);
2164
- while (this.cachApiCallDate[serviceNameKay] && (new Date().getTime() - this.cachApiCallDate[serviceNameKay].getTime()) < this.cashApiSeconds) {
2165
- if (this.cachApiResult[serviceNameKay]?.isSuccess)
2166
- return of(this.cachApiResult[serviceNameKay]);
2167
- }
2168
- this.cachApiCallDate[serviceNameKay] = new Date();
2169
2161
  }
2170
2162
  //! optimaze call api
2171
2163
  return this.http
@@ -2176,7 +2168,10 @@ class CoreEnumService extends ApiServerBase {
2176
2168
  // catchError(this.handleError)
2177
2169
  map((ret) => {
2178
2170
  //! optimaze call api
2179
- this.cachApiResult[serviceName] = ret;
2171
+ if (this.getModuleCashService().includes(serviceName)) {
2172
+ this.cachApiResult[serviceNameKay] = ret;
2173
+ this.cachApiResult[serviceNameKay].dateResult = new Date();
2174
+ }
2180
2175
  //! optimaze call api
2181
2176
  return this.errorExceptionResultCheck(ret);
2182
2177
  }));