fix validation and translation issues

This commit is contained in:
Mohit Panjwani
2019-11-11 13:44:24 +05:30
parent d3310b71bd
commit ae6290108b
10 changed files with 105 additions and 28 deletions

View File

@ -78,8 +78,12 @@ export const addInvoice = ({ commit, dispatch, state }, data) => {
export const deleteInvoice = ({ commit, dispatch, state }, id) => {
return new Promise((resolve, reject) => {
window.axios.delete(`/api/invoices/${id}`).then((response) => {
commit(types.DELETE_INVOICE, id)
resolve(response)
if (response.data.error) {
resolve(response)
} else {
commit(types.DELETE_INVOICE, id)
resolve(response)
}
}).catch((err) => {
reject(err)
})