fix status action in view estimate

This commit is contained in:
satyaprakash10
2019-11-15 19:43:42 +05:30
parent e018d71443
commit d529c1d68f
5 changed files with 71 additions and 19 deletions

View File

@ -56,6 +56,7 @@ export const fetchViewEstimate = ({ commit, dispatch, state }, id) => {
export const sendEmail = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.post(`/api/estimates/send`, data).then((response) => {
commit(types.UPDATE_ESTIMATE_STATUS, {id: data.id, status: 'SENT'})
resolve(response)
}).catch((err) => {
reject(err)
@ -100,7 +101,7 @@ export const deleteMultipleEstimates = ({ commit, dispatch, state }, id) => {
export const updateEstimate = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.put(`/api/estimates/${data.id}`, data).then((response) => {
commit(types.UPDATE_ESTIMATE, response.data)
commit(types.UPDATE_ESTIMATE_STATUS, response.data)
resolve(response)
}).catch((err) => {
reject(err)