fix: message error to reject proposal
This commit is contained in:
@@ -57,6 +57,6 @@ export const updateProposal = async(id, formData) => {
|
||||
const {data} = await api.patch(endpoint, formData);
|
||||
return data;
|
||||
} catch (error) {
|
||||
return null;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -191,6 +191,7 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
}
|
||||
|
||||
const updatePropsalLoad = async(id, formData, localData) => {
|
||||
try {
|
||||
const data = await updateProposal(id, formData);
|
||||
if(data) {
|
||||
const index = proposals.value.findIndex((prop) => prop._id === id);
|
||||
@@ -203,6 +204,9 @@ export const useCompanyStore = defineStore('company', () => {
|
||||
} else {
|
||||
return t('errors.generic');
|
||||
}
|
||||
} catch (error) {
|
||||
return error.response?.data?.error ?? t('errors.generic');
|
||||
}
|
||||
}
|
||||
|
||||
const getBudgetsCompany = async(filterQuery, reload = false) => { //here
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
Swal.close();
|
||||
|
||||
if(resp != null) {
|
||||
if(resp === 'success') {
|
||||
Swal.fire({
|
||||
title: t('proposals.msgTitleRetire'),
|
||||
text: t('proposals.msgCancel'),
|
||||
@@ -63,7 +63,7 @@
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: "Error",
|
||||
text: t('proposals.msgNotCancel'),
|
||||
text: resp,
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user