I am attempting to delete a commerce line item with ajax request but nothing ever deletes. Am i doing something wrong? Vue function below:
removeLine(id) {
axios.post('', {
[this.csrfName]: this.csrfToken,
action: 'commerce/cart/update-cart',
lineItems: {[id]: {'remove': true}}
},
{
headers: {
'X-CSRF-Token': this.csrfToken
},
}).then(function (response) {
}).catch(function (error) {
// handle error
console.log(error);
}).finally(function () {
// always executed
});
}