@esolve/ng-esolve-connect 0.18.1 → 0.19.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.
- package/esm2020/lib/cart/esolve-cart-additional-where.interface.mjs +2 -0
- package/esm2020/lib/cart/esolve-cart-empty-response.interface.mjs +2 -0
- package/esm2020/lib/cart/esolve-cart.service.mjs +22 -1
- package/esm2020/lib/cart/esolve-empty-cart-result.model.mjs +4 -0
- package/esm2020/lib/cart/index.mjs +3 -1
- package/esm2020/lib/locations/esolve-location.model.mjs +4 -4
- package/fesm2015/esolve-ng-esolve-connect.mjs +26 -3
- package/fesm2015/esolve-ng-esolve-connect.mjs.map +1 -1
- package/fesm2020/esolve-ng-esolve-connect.mjs +26 -3
- package/fesm2020/esolve-ng-esolve-connect.mjs.map +1 -1
- package/lib/cart/esolve-cart-additional-where.interface.d.ts +6 -0
- package/lib/cart/esolve-cart-empty-response.interface.d.ts +3 -0
- package/lib/cart/esolve-cart.service.d.ts +3 -0
- package/lib/cart/esolve-empty-cart-result.model.d.ts +3 -0
- package/lib/cart/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1802,13 +1802,13 @@ class EsolveLocation {
|
|
|
1802
1802
|
this.id = +record.id;
|
|
1803
1803
|
this.identifier = record.identifier;
|
|
1804
1804
|
this.description = record.description;
|
|
1805
|
-
this.head_office = record.head_office;
|
|
1805
|
+
this.head_office = !!+record.head_office;
|
|
1806
1806
|
this.erp_identifier = record.erp_identifier;
|
|
1807
1807
|
this.external_system_code = record.external_system_code;
|
|
1808
|
-
this.default_location_for_payment_methods = record.default_location_for_payment_methods;
|
|
1808
|
+
this.default_location_for_payment_methods = !!+record.default_location_for_payment_methods;
|
|
1809
1809
|
this.userid = +record.userid;
|
|
1810
1810
|
this.importance = +record.importance;
|
|
1811
|
-
this.active = record.is_active;
|
|
1811
|
+
this.active = !!+record.is_active;
|
|
1812
1812
|
this.website_url = record.website_url;
|
|
1813
1813
|
this.address = new EsolveLocationAddress(record.street, record.suburb, record.city, record.province, record.country, record.postal_code, +record.latitude, +record.longitude);
|
|
1814
1814
|
this.pobox_address = new EsolveLocationPOBoxAddress(record.pobox, record.pobox_city, record.pobox_postal_code);
|
|
@@ -3884,6 +3884,9 @@ class EsolveCartTotals {
|
|
|
3884
3884
|
}
|
|
3885
3885
|
}
|
|
3886
3886
|
|
|
3887
|
+
class EsolveEmptyCartResult extends EsolveResponseResult {
|
|
3888
|
+
}
|
|
3889
|
+
|
|
3887
3890
|
class EsolveCartService {
|
|
3888
3891
|
constructor(config, http, errorHandler, responseHandler) {
|
|
3889
3892
|
this.config = config;
|
|
@@ -3934,6 +3937,26 @@ class EsolveCartService {
|
|
|
3934
3937
|
return response.responses;
|
|
3935
3938
|
}));
|
|
3936
3939
|
}
|
|
3940
|
+
setCartEmpty(type, additional_where) {
|
|
3941
|
+
const body = {
|
|
3942
|
+
type,
|
|
3943
|
+
additional_where
|
|
3944
|
+
};
|
|
3945
|
+
return this.http
|
|
3946
|
+
.post(`${this.config.api_url}/set-cart-empty.php`, body, {
|
|
3947
|
+
headers: {
|
|
3948
|
+
'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8;'
|
|
3949
|
+
},
|
|
3950
|
+
responseType: 'json',
|
|
3951
|
+
observe: 'body',
|
|
3952
|
+
})
|
|
3953
|
+
.pipe(map((http_response) => this.responseHandler.validateSingleHttpResponse(http_response, (response) => {
|
|
3954
|
+
this._cached_tracking = 0;
|
|
3955
|
+
return new EsolveEmptyCartResult(response);
|
|
3956
|
+
})), catchError((errorRes) => {
|
|
3957
|
+
return this.errorHandler.handleHttpPostError('set-cart-empty', errorRes);
|
|
3958
|
+
}));
|
|
3959
|
+
}
|
|
3937
3960
|
/**
|
|
3938
3961
|
* Retrieves the totals of the cart with all the totals calculated
|
|
3939
3962
|
*
|