taxtank-core 0.31.15 → 0.31.17

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.
@@ -10300,9 +10300,6 @@ let RestService$1 = class RestService extends DataService {
10300
10300
  */
10301
10301
  this.disabledMethods = [];
10302
10302
  this.roles = [];
10303
- this.eventDispatcherService.on2(User.getEventName('get')).subscribe((data) => {
10304
- this.user = data[0];
10305
- });
10306
10303
  // @TODO Alex remove, bad idea to call empty method overrided in child (because it will be called with parent context)
10307
10304
  this.listenEvents();
10308
10305
  }
@@ -10331,14 +10328,13 @@ let RestService$1 = class RestService extends DataService {
10331
10328
  this.setCache([]);
10332
10329
  return this.http.get(path)
10333
10330
  .pipe(map((response) => this.isApiPlatform ? response['hydra:member'] : toArray(response)), map((response) => {
10334
- const result = response.map((item) => this.createModelInstance(item));
10335
- this.handleResponse(result, 'get');
10331
+ this.setCache(response, true);
10336
10332
  return this.cache;
10337
10333
  }));
10338
10334
  }
10339
10335
  get(path = this.apiUrl) {
10340
10336
  if (!this.cache) {
10341
- (!this.user || this.user.hasRoles(this.roles)) ? this.fetch(path).pipe(first$1()).subscribe() : this.setCache([], true);
10337
+ this.fetch(path).pipe(first$1()).subscribe();
10342
10338
  }
10343
10339
  return this.cacheSubject.asObservable();
10344
10340
  }
@@ -10876,8 +10872,8 @@ class BasiqTokenService extends RestService$1 {
10876
10872
  * Access token to use basiq flow
10877
10873
  */
10878
10874
  get() {
10879
- if (this.cache && this.cache.first.isExpired()) {
10880
- this.setCache(undefined);
10875
+ if (this.cache && this.getCacheFirst().isExpired()) {
10876
+ this.cache = undefined;
10881
10877
  }
10882
10878
  return super.get();
10883
10879
  }
@@ -11807,9 +11803,6 @@ class RestService {
11807
11803
  // subject for service cache
11808
11804
  this.cacheSubject = new ReplaySubject(1);
11809
11805
  this.roles = [];
11810
- this.eventDispatcherService.on2(User.getEventName('get')).subscribe((data) => {
11811
- this.user = data[0];
11812
- });
11813
11806
  this.listenEvents();
11814
11807
  }
11815
11808
  /**
@@ -11830,7 +11823,7 @@ class RestService {
11830
11823
  */
11831
11824
  get() {
11832
11825
  if (!this.cache) {
11833
- (!this.user || this.user.hasRoles(this.roles)) ? this.fetch().pipe(first$1()).subscribe() : this.setCache([], true);
11826
+ this.fetch().pipe(first$1()).subscribe();
11834
11827
  }
11835
11828
  return this.cacheSubject.asObservable();
11836
11829
  }