Page 1 of 1

favorite product json delete not working

Posted: 26 Nov 2020, 15:52
by Dinver
I create delete request, but nothing happens. Errors not, but does not delete anything.

Code: Select all

const url = '/jsonapi/customer?related=relationships&include=product&relatedid=' + id
		$.ajax({
			url: url,
			method: 'DELETE',
			headers: {
				'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
			}
		}).done(function(result) {
				console.log(result)
		})
response:

Code: Select all

{
"meta": {
"total": 0,
"prefix": null,
"content-baseurl": "http://shop.loc"
, "csrf": {
"name": "_token",
"value": "fIBH6KiZuCjDUOmrMbUYXlBoyRynflrywKJgmTpb"
}

},
"links": {
"self": "http://shop.loc/jsonapi/customer?related=relationships&include=product&relatedid=1",
"related": "http://shop.loc/jsonapi/customer?related=relationships&include=product"
}

}