I have a function like this:
async deleteBuilding ({ commit, state }, payload) {
const urlEnd = '/v1/building/update'
const type = 'delete'
const resp = await api.asyncRequest(urlEnd, type, payload)
commit('DELETE_BUILDING', resp.data)
return resp
},
api.asyncRequest = async (urlEnd, type, payload = {}) => {
return await Vue.http[type](api.serverUrl + urlEnd, payload, timeout)
}
As you can see, I'm feeding a payload to the DELETE request (the ID of the building that I want to delete). However, the payload never makes it to the request.
Is this DELETE's normal behavior? If so, how to add a payload to a DELETE request?