@snabcentr/client-core 4.14.2 → 4.15.0

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.
@@ -1931,7 +1931,12 @@ class ScCachedItem {
1931
1931
  this.lifeTime = lifeTime;
1932
1932
  const requestData$ = this.update$.pipe(switchMap(() => item$.pipe(tap(() => {
1933
1933
  this.updateCacheTime();
1934
- }), startWith$1((initialValue ?? null)))), materialize(), shareReplay(1), dematerialize());
1934
+ }), startWith$1((initialValue ?? null)))), materialize(), tap((notification) => {
1935
+ // Ошибка не кэшируется - следующее обращение инициирует повторный запрос.
1936
+ if (notification.kind === 'E') {
1937
+ this.cachedUntil = Date.now() - 1;
1938
+ }
1939
+ }), shareReplay(1), dematerialize());
1935
1940
  this.item$ = merge(this.currentValue$, requestData$).pipe(shareReplay(1));
1936
1941
  }
1937
1942
  /**
@@ -3459,23 +3464,6 @@ class ScCatalogService {
3459
3464
  return data.map((item, index) => new ScProduct(item, index));
3460
3465
  }));
3461
3466
  }
3462
- /**
3463
- * Создает запрос получения списка товаров, созданных за указанный период (с пагинацией).
3464
- *
3465
- * @param params Параметры запроса товаров за период.
3466
- */
3467
- getNewProducts$(params) {
3468
- return this.http
3469
- .get(`${this.urls.apiUrl}/catalog/products/new`, {
3470
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
3471
- params: this.convertersService.toHttpParams({ ...params }, { nonNullable: true }),
3472
- })
3473
- .pipe(map$1((data) => {
3474
- const cloneData = structuredClone(data);
3475
- cloneData.data = cloneData.data.map((item) => new ScProduct(item));
3476
- return cloneData;
3477
- }));
3478
- }
3479
3467
  /**
3480
3468
  * Создает запрос получения списка товаров категории и кэширует его.
3481
3469
  *