ntk-cms-api 1.2.227 → 1.2.229

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.
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Component, NgModule, Inject } from '@angular/core';
3
- import { BehaviorSubject, Subject, throwError } from 'rxjs';
3
+ import { BehaviorSubject, Subject, throwError, of } from 'rxjs';
4
4
  import { distinctUntilChanged, map, retry } from 'rxjs/operators';
5
5
  import * as i2 from '@angular/common/http';
6
6
  import { HttpClient } from '@angular/common/http';
@@ -2120,6 +2120,14 @@ class CoreEnumService extends ApiServerBase {
2120
2120
  return 'CoreEnum';
2121
2121
  }
2122
2122
  ServiceRecordStatusEnum() {
2123
+ //! optimaze call api
2124
+ do {
2125
+ if (this.serviceRecordStatusEnumLastResult?.isSuccess) {
2126
+ return of(this.serviceRecordStatusEnumLastResult);
2127
+ }
2128
+ } while (this.serviceRecordStatusEnumInCall && this.serviceRecordStatusEnumInCall.getTime() - new Date().getTime() > 10);
2129
+ this.serviceRecordStatusEnumInCall = new Date();
2130
+ //! optimaze call api
2123
2131
  return this.http
2124
2132
  .get(this.getBaseUrl() + this.getModuleControllerUrl() + '/RecordStatusEnum', {
2125
2133
  headers: this.getHeaders(),
@@ -2127,6 +2135,7 @@ class CoreEnumService extends ApiServerBase {
2127
2135
  .pipe(
2128
2136
  // catchError(this.handleError)
2129
2137
  map((ret) => {
2138
+ this.serviceRecordStatusEnumLastResult = ret;
2130
2139
  return this.errorExceptionResultCheck(ret);
2131
2140
  }));
2132
2141
  }