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