ng-easycommerce 0.0.674 → 0.0.675

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.
package/README.md CHANGED
@@ -1,3 +1,7 @@
1
+ # version 0.0.675
2
+ - `PaginationService`: se corrige el flujo de búsqueda/paginado cuando la respuesta no trae `links.next` (búsquedas sin resultados), evitando errores de `slice` sobre `undefined`.
3
+ - `PaginationService.cleanRoute`: ahora valida rutas vacías/undefined y retorna string seguro.
4
+ - `PaginationService.initialize`: emite `finishedSubject.next(false)` al iniciar una nueva búsqueda para resetear correctamente el estado de carga/finalización.
1
5
  # version 0.0.674
2
6
  - Checkout single (envíos): `shipping-option` vuelve a enviar los datos que antes se persistían vía `shipping-contract` para contratos de sucursal OCA.
3
7
  - Checkout single (envíos): se completa el payload con `name`, `price`, `selected`, datos de sucursal (`street`, `number`, `province`, `city`, `code`, `description`, `address`, `computed`) y claves de método (`shipping_method_contract`, `shipping_method_branch_code`).
@@ -750,13 +750,14 @@
750
750
  _this.nextSubject.next(response.items);
751
751
  _this.waiting = false;
752
752
  };
753
- this.cleanRoute = function (route) { return route.slice(1); };
753
+ this.cleanRoute = function (route) { return route ? route.slice(1) : ''; };
754
754
  this.isFinished = function () { return _this.finished; };
755
755
  }
756
756
  PaginationService.prototype.initialize = function (api, limit, initialValues) {
757
757
  this.api = api;
758
758
  this.limit = limit || this.limit || 10;
759
759
  this.finished = false;
760
+ this.finishedSubject.next(false);
760
761
  this.nextSubject.next([]);
761
762
  };
762
763
  PaginationService.prototype.getNext = function (next) {
@@ -767,7 +768,7 @@
767
768
  ? this.connection.get(this.api, { limit: this.limit, page: 1 })
768
769
  : this.connection.get(this.api);
769
770
  !this.finished && nextProducts.subscribe(function (response) {
770
- response.links ? _this.updatePageData(response) : _this.finalize(response);
771
+ response.links && response.links.next ? _this.updatePageData(response) : _this.finalize(response);
771
772
  next && next(response);
772
773
  });
773
774
  return true;