simpo-component-library 2.0.26 → 2.0.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -159,51 +159,6 @@ export class StorageServiceService {
159
159
  const transaction = this.database.transaction(this.cartCollectionName, "readwrite");
160
160
  return await transaction.objectStore(this.cartCollectionName).getAll();
161
161
  }
162
- async getCartProduct() {
163
- try {
164
- const cartResponse = await this.getUserCart();
165
- return new Promise((resolve, reject) => {
166
- cartResponse.onsuccess = async (cartData) => {
167
- const indexDBProduct = cartData.target.result;
168
- const userDetails = this.getUser();
169
- if (userDetails?.userId) {
170
- try {
171
- const response = await this.restService.getUserItems(userDetails?.userId, "CART").toPromise();
172
- if (response.data?.[0]?.cartId)
173
- localStorage.setItem('cartId', response.data?.[0]?.cartId);
174
- const serverDBProduct = response?.data?.[0]?.orderedItems ?? [];
175
- for (let localProduct of indexDBProduct) {
176
- let productFound = false;
177
- for (let serverProduct of serverDBProduct) {
178
- if (serverProduct.varientId === localProduct.varientId) {
179
- serverProduct.quantity += localProduct.quantity;
180
- productFound = true;
181
- }
182
- }
183
- if (!productFound) {
184
- serverDBProduct.push(localProduct);
185
- }
186
- }
187
- this.totalCartItems = serverDBProduct?.length || 0;
188
- resolve(serverDBProduct);
189
- }
190
- catch (error) {
191
- console.error("Error in API call:", error);
192
- reject(error);
193
- }
194
- }
195
- else {
196
- this.totalCartItems = indexDBProduct?.length || 0;
197
- resolve(indexDBProduct);
198
- }
199
- };
200
- });
201
- }
202
- catch (error) {
203
- console.error("Error retrieving cart:", error);
204
- throw error;
205
- }
206
- }
207
162
  addProductToCart(product) {
208
163
  const transaction = this.database.transaction(this.cartCollectionName, "readwrite");
209
164
  const response = transaction.objectStore(this.cartCollectionName).get(product.varientId);
@@ -294,4 +249,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImpor
294
249
  providedIn: 'root'
295
250
  }]
296
251
  }], ctorParameters: () => [{ type: i1.EventsService }, { type: i2.CookieService }, { type: i3.RestService }, { type: i4.Router }] });
297
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2R1Y3QpIHtcclxuICAgICAgICAgICAgICAgIGxldCBwcm9kdWN0Rm91bmQgPSBmYWxzZTtcclxuICAgICAgICAgICAgICAgIGZvciAobGV0IHNlcnZlclByb2R1Y3Qgb2Ygc2VydmVyREJQcm9kdWN0KSB7XHJcbiAgICAgICAgICAgICAgICAgIGlmIChzZXJ2ZXJQcm9kdWN0LnZhcmllbnRJZCA9PT0gbG9jYWxQcm9kdWN0LnZhcmllbnRJZCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHNlcnZlclByb2R1Y3QucXVhbnRpdHkgKz0gbG9jYWxQcm9kdWN0LnF1YW50aXR5O1xyXG4gICAgICAgICAgICAgICAgICAgIHByb2R1Y3RGb3VuZCA9IHRydWU7XHJcbiAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGlmICghcHJvZHVjdEZvdW5kKSB7XHJcbiAgICAgICAgICAgICAgICAgIHNlcnZlckRCUHJvZHVjdC5wdXNoKGxvY2FsUHJvZHVjdCk7XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgIHRoaXMudG90YWxDYXJ0SXRlbXMgPSBzZXJ2ZXJEQlByb2R1Y3Q/Lmxlbmd0aCB8fCAwO1xyXG4gICAgICAgICAgICAgIHJlc29sdmUoc2VydmVyREJQcm9kdWN0KTtcclxuICAgICAgICAgICAgfSBjYXRjaCAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKFwiRXJyb3IgaW4gQVBJIGNhbGw6XCIsIGVycm9yKTtcclxuICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICB0aGlzLnRvdGFsQ2FydEl0ZW1zID0gaW5kZXhEQlByb2R1Y3Q/Lmxlbmd0aCB8fCAwO1xyXG4gICAgICAgICAgICByZ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IsIHBheW1lbnRGb3IsIDcpO1xyXG4gIH1cclxuXHJcblxyXG4gIC8vIGNsZWFyQWxsSXRlbXNGcm9tQ2FydCgpIHtcclxuICAvLyAgIHJldHVybiBuZXcgUHJvbWlzZShhc3luYyAocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XHJcbiAgLy8gICAgIGlmICh0aGlzLmRhdGFiYXNlICE9IHVuZGVmaW5lZCkge1xyXG4gIC8vICAgICAgIGNvbnN0IHJlcXVlc3QgPSBhd2FpdCB0aGlzLmRhdGFiYXNlXHJcbiAgLy8gICAgICAgICAudHJhbnNhY3Rpb24odGhpcy5vYmplY3RTdG9yYWdlTmFtZSwgJ3JlYWR3cml0ZScpXHJcbiAgLy8gICAgICAgICAub2JqZWN0U3RvcmUodGhpcy5vYmplY3RTdG9yYWdlTmFtZSlcclxuICAvLyAgICAgICAgIC5jbGVhcigpO1xyXG5cclxuICAvLyAgICAgICByZXF1ZXN0Lm9uc3VjY2VzcyA9IGF3YWl0IGZ1bmN0aW9uIChldmVudDogYW55KSB7XHJcblxyXG4gIC8vICAgICAgICAgaWYgKGV2ZW50LnRhcmdldC5yZXN1bHQpIHtcclxuICAvLyAgICAgICAgICAgcmVzb2x2ZShldmVudC5yZXN1bHQpO1xyXG4gIC8vICAgICAgICAgfSBlbHNlIHtcclxuICAvLyAgICAgICAgICAgcmVzb2x2ZSgnU1VDQ0VTUycpO1xyXG4gIC8vICAgICAgICAgfVxyXG4gIC8vICAgICAgIH07XHJcbiAgLy8gICAgICAgcmVxdWVzdC5vbmVycm9yID0gYXdhaXQgZnVuY3Rpb24gKF9ldmVudCkge1xyXG4gIC8vICAgICAgICAgcmVqZWN0KFwiTm8gZGF0YVwiKTtcclxuICAvLyAgICAgICB9XHJcbiAgLy8gICAgIH1cclxuICAvLyAgIH0pO1xyXG4gIC8vIH1cclxufVxyXG4iXX0=
252
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmFnZS5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