@infrab4a/connect-angular 4.0.5 → 4.0.6

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.
@@ -1630,24 +1630,6 @@ __decorate([
1630
1630
  __metadata("design:type", Array)
1631
1631
  ], CategoryWithTree.prototype, "children", void 0);
1632
1632
 
1633
- class UtilHelper {
1634
- static createSlug(name) {
1635
- return name
1636
- .toLowerCase()
1637
- .replace(/\s+/g, '-') // Replace spaces with -
1638
- .replace(/[ãàáäâ]/g, 'a') // Replace spaces with -
1639
- .replace(/[ẽèéëê]/g, 'e') // Replace spaces with -
1640
- .replace(/[ìíïî]/g, 'i') // Replace spaces with -
1641
- .replace(/[õòóöô]/g, 'o') // Replace spaces with -
1642
- .replace(/[ùúüû]/g, 'u') // Replace spaces with -
1643
- .replace(/[ñ]/g, 'n') // Replace spaces with -
1644
- .replace(/[ç]/g, 'c') // Replace spaces with -
1645
- .replace(/[&]/g, 'and') // Replace spaces with -
1646
- .replace(/[^\w\-]+/g, '') // Remove all non-word chars
1647
- .replace(/\-\-+/g, '-'); // Replace multiple - with single -
1648
- }
1649
- }
1650
-
1651
1633
  class NewCategoryStructureAdapter {
1652
1634
  constructor(categoryRepository) {
1653
1635
  this.categoryRepository = categoryRepository;
@@ -1722,7 +1704,7 @@ class WishlistService {
1722
1704
  }
1723
1705
  async create(personId, title, description, userFullName, userPhoto) {
1724
1706
  const data = {
1725
- slug: UtilHelper.createSlug(`favoritos ${title}`),
1707
+ slug: 'favoritos',
1726
1708
  name: title,
1727
1709
  description,
1728
1710
  metadata: {
@@ -1743,7 +1725,6 @@ class WishlistService {
1743
1725
  update(id, title, description, userFullName, userPhoto) {
1744
1726
  const data = {
1745
1727
  id,
1746
- slug: UtilHelper.createSlug(`${id}-favoritos ${title}`),
1747
1728
  name: title,
1748
1729
  description,
1749
1730
  metadata: {
@@ -1759,6 +1740,9 @@ class WishlistService {
1759
1740
  return this.wishlistRepository.delete({ id: wishlistId });
1760
1741
  }
1761
1742
  getWishlistBySlug(slug) {
1743
+ const [id] = slug.split('-');
1744
+ if (+id)
1745
+ return this.wishlistRepository.get({ id });
1762
1746
  return this.wishlistRepository.getWishlistBySlug(slug);
1763
1747
  }
1764
1748
  getWishlistsByPerson(personId) {
@@ -1848,6 +1832,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
1848
1832
  args: ['SubscriptionRepository']
1849
1833
  }] }, { type: CouponService }]; } });
1850
1834
 
1835
+ class UtilHelper {
1836
+ static createSlug(name) {
1837
+ return name
1838
+ .toLowerCase()
1839
+ .replace(/\s+/g, '-') // Replace spaces with -
1840
+ .replace(/[ãàáäâ]/g, 'a') // Replace spaces with -
1841
+ .replace(/[ẽèéëê]/g, 'e') // Replace spaces with -
1842
+ .replace(/[ìíïî]/g, 'i') // Replace spaces with -
1843
+ .replace(/[õòóöô]/g, 'o') // Replace spaces with -
1844
+ .replace(/[ùúüû]/g, 'u') // Replace spaces with -
1845
+ .replace(/[ñ]/g, 'n') // Replace spaces with -
1846
+ .replace(/[ç]/g, 'c') // Replace spaces with -
1847
+ .replace(/[&]/g, 'and') // Replace spaces with -
1848
+ .replace(/[^\w\-]+/g, '') // Remove all non-word chars
1849
+ .replace(/\-\-+/g, '-'); // Replace multiple - with single -
1850
+ }
1851
+ }
1852
+
1851
1853
  class HomeShopService {
1852
1854
  constructor(categoryRepository, homeRepository, productRepository, defaultShop) {
1853
1855
  this.categoryRepository = categoryRepository;