fix estimate status in view page

This commit is contained in:
yogesh_gohil
2019-11-16 13:52:46 +05:30
parent 69fbf73d6d
commit 8e13518524
2 changed files with 6 additions and 23 deletions

View File

@ -101,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_STATUS, response.data)
commit(types.UPDATE_ESTIMATE, response.data)
resolve(response)
}).catch((err) => {
reject(err)
@ -132,7 +132,7 @@ export const markAsRejected = ({ commit, dispatch, state }, data) => {
export const markAsSent = ({ commit, dispatch, state }, data) => {
return new Promise((resolve, reject) => {
window.axios.post(`/api/estimates/mark-as-sent`, data).then((response) => {
// commit(types.UPDATE_INVOICE, response.data)
commit(types.UPDATE_ESTIMATE_STATUS, {id: data.id, status: 'SENT'})
resolve(response)
}).catch((err) => {
reject(err)