Reset
This endpoint is used when the customer removes an added reward from the live cart. In some cases, customers may need to remove a prize after adding it to the live cart.
:::tip
The reset endpoint has been implemented in the Loyalty Web Component, , and It's all setup to save developer's time and effort.
:::
Response
Usage
To perform the action of removing an added reward from the live cart, the method reset()
may be called as below, with the id of the order to be rated.
salla.loyalty.reset().then((response) => {
/* add your code here */
});
Events
This endpoint may trigger two events, the onResetSucceeded and onResetFailed events.
onResetSucceeded
This event is triggered when the action of removing an added reward from the live cart is done without having any errors coming back from the backend.
salla.event.rating.onResetSucceeded((response) => {
console.log(response)
});
onResetFailed
This event is triggered when the action of removing an added reward from the live cart is not completed and an error has occurred.
```js
salla.event.rating.onResetFailed((errorMessage) => {
console.log(errorMessage)
});