fix: message error to reject proposal

This commit is contained in:
Alexandro Uc Santos
2025-07-26 19:38:09 -06:00
parent ba630fb1de
commit c600671934
3 changed files with 18 additions and 14 deletions

View File

@@ -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;
} }
} }

View File

@@ -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

View File

@@ -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"
}); });
} }