Skip to content

Instantly share code, notes, and snippets.

@cyberfly
Last active September 9, 2020 06:07
Show Gist options
  • Save cyberfly/c639cfe6283db5dadf9fbbb3e4cc242f to your computer and use it in GitHub Desktop.
Save cyberfly/c639cfe6283db5dadf9fbbb3e4cc242f to your computer and use it in GitHub Desktop.
const { id, ...payload_without_id } = payload;
// use case
updateMilestone({ commit, state, getters }, payload) {
const { id, ...payload_without_id } = payload;
const url = `${base_url}api/milestones/${id}/`;
return axios
.patch(url, payload_without_id)
.then(response => {
let milestone = response.data;
commit('updateMilestone', milestone);
return milestone;
})
.catch(function (error) {
console.log("error res -->", error);
throw error;
});
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment