use DELETE instead of POST for delete action
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user