use DELETE instead of POST for delete action

This commit is contained in:
Bilal Catic
2018-09-20 13:57:01 +02:00
parent 5da2353d04
commit 41e92e2390
2 changed files with 10 additions and 18 deletions

View File

@@ -52,11 +52,8 @@ export const removeProfileAddress = (idUser, idProfileAddress) => {
return dispatch => {
dispatch(requestRemoveAddress());
return client.fetch({
url: `${API_SERVER}/wp-json/wiaas/customer/${idUser}/profile-addresses`,
method: 'post',
data: {
'address_id':idProfileAddress
}
url: `${API_SERVER}/wp-json/wiaas/customer/${idUser}/profile-addresses/${idProfileAddress}`,
method: 'delete'
})
.then(response => {
if(response.data){
@@ -105,11 +102,8 @@ export const removeBillingAddress = (idUser, idBillingAddress) => {
return dispatch => {
dispatch(requestRemoveBillingAddress());
return client.fetch({
url: `${API_SERVER}/wp-json/wiaas/customer/${idUser}/billing-addresses`,
method: 'POST',
data: {
'address_id':idBillingAddress
}
url: `${API_SERVER}/wp-json/wiaas/customer/${idUser}/billing-addresses/${idBillingAddress}`,
method: 'delete'
})
.then(response => {
if(response.data){