feat: refs #8039 canceledError not notify #850

Merged
alexm merged 17 commits from 8039-canceledError_not_notify into dev 2024-10-24 12:44:19 +00:00
14 changed files with 228 additions and 371 deletions
Showing only changes of commit dd2dc86eea - Show all commits

View File

@ -46,13 +46,9 @@ const columns = computed(() => [
]); ]);
const deleteAlias = async (row) => { const deleteAlias = async (row) => {
try {
await axios.delete(`${urlPath.value}/${row.id}`); await axios.delete(`${urlPath.value}/${row.id}`);
notify(t('User removed'), 'positive'); notify(t('User removed'), 'positive');
fetchAliases(); fetchAliases();
} catch (error) {
console.error(error);
}
}; };
watch( watch(

View File

@ -61,23 +61,15 @@ const fetchAccountExistence = async () => {
}; };
const deleteMailAlias = async (row) => { const deleteMailAlias = async (row) => {
try {
await axios.delete(`${urlPath}/${row.id}`); await axios.delete(`${urlPath}/${row.id}`);
fetchMailAliases(); fetchMailAliases();
notify(t('Unsubscribed from alias!'), 'positive'); notify(t('Unsubscribed from alias!'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const createMailAlias = async (mailAliasFormData) => { const createMailAlias = async (mailAliasFormData) => {
try {
await axios.post(urlPath, mailAliasFormData); await axios.post(urlPath, mailAliasFormData);
notify(t('Subscribed to alias!'), 'positive'); notify(t('Subscribed to alias!'), 'positive');
fetchMailAliases(); fetchMailAliases();
} catch (error) {
console.error(error);
}
}; };
const fetchMailAliases = async () => { const fetchMailAliases = async () => {

View File

@ -46,29 +46,15 @@ const columns = computed(() => [
]); ]);
const deleteSubRole = async (row) => { const deleteSubRole = async (row) => {
try {
await axios.delete(`${urlPath.value}/${row.id}`); await axios.delete(`${urlPath.value}/${row.id}`);
fetchSubRoles(); fetchSubRoles();
notify( notify(t('Role removed. Changes will take a while to fully propagate.'), 'positive');
t('Role removed. Changes will take a while to fully propagate.'),
'positive'
);
} catch (error) {
console.error(error);
}
}; };
const createSubRole = async (subRoleFormData) => { const createSubRole = async (subRoleFormData) => {
try {
await axios.post(urlPath.value, subRoleFormData); await axios.post(urlPath.value, subRoleFormData);
notify( notify(t('Role added! Changes will take a while to fully propagate.'), 'positive');
t('Role added! Changes will take a while to fully propagate.'),
'positive'
);
fetchSubRoles(); fetchSubRoles();
} catch (error) {
console.error(error);
}
}; };
watch( watch(

View File

@ -112,32 +112,20 @@ const getShipped = async (params) => {
}; };
const onChangeZone = async (zoneId) => { const onChangeZone = async (zoneId) => {
try {
formData.value.agencyModeFk = null; formData.value.agencyModeFk = null;
const { data } = await axios.get(`Zones/${zoneId}`); const { data } = await axios.get(`Zones/${zoneId}`);
formData.value.agencyModeFk = data.agencyModeFk; formData.value.agencyModeFk = data.agencyModeFk;
} catch (error) {
console.error(error);
}
}; };
const onChangeAddress = async (addressId) => { const onChangeAddress = async (addressId) => {
try {
formData.value.nickname = null; formData.value.nickname = null;
const { data } = await axios.get(`Addresses/${addressId}`); const { data } = await axios.get(`Addresses/${addressId}`);
formData.value.nickname = data.nickname; formData.value.nickname = data.nickname;
} catch (error) {
console.error(error);
}
}; };
const getClientDefaultAddress = async (clientId) => { const getClientDefaultAddress = async (clientId) => {
try {
const { data } = await axios.get(`Clients/${clientId}`); const { data } = await axios.get(`Clients/${clientId}`);
if (data) addressId.value = data.defaultAddressFk; if (data) addressId.value = data.defaultAddressFk;
} catch (error) {
console.error(error);
}
}; };
const clientAddressesList = async (value) => { const clientAddressesList = async (value) => {

View File

@ -70,7 +70,6 @@ const isFormInvalid = () => {
}; };
const getPriceDifference = async () => { const getPriceDifference = async () => {
try {
const params = { const params = {
landed: formData.value.landed, landed: formData.value.landed,
addressId: formData.value.addressFk, addressId: formData.value.addressFk,
@ -84,15 +83,10 @@ const getPriceDifference = async () => {
params params
); );
formData.value.sale = data; formData.value.sale = data;
} catch (error) {
console.error(error);
}
}; };
const submit = async () => { const submit = async () => {
try { if (!formData.value.option) return notify(t('basicData.chooseAnOption'), 'negative');
if (!formData.value.option)
return notify(t('basicData.chooseAnOption'), 'negative');
const params = { const params = {
clientFk: formData.value.clientFk, clientFk: formData.value.clientFk,
@ -121,9 +115,6 @@ const submit = async () => {
const ticketToMove = data.id; const ticketToMove = data.id;
notify(t('basicData.unroutedTicket'), 'positive'); notify(t('basicData.unroutedTicket'), 'positive');
router.push({ name: 'TicketSummary', params: { id: ticketToMove } }); router.push({ name: 'TicketSummary', params: { id: ticketToMove } });
} catch (error) {
console.error(error);
}
}; };
const submitWithNegatives = async () => { const submitWithNegatives = async () => {

View File

@ -34,10 +34,7 @@ const newTicketFormData = reactive({});
const date = new Date(); const date = new Date();
const createTicket = async () => { const createTicket = async () => {
try { const expeditionIds = $props.selectedExpeditions.map((expedition) => expedition.id);
const expeditionIds = $props.selectedExpeditions.map(
(expedition) => expedition.id
);
const params = { const params = {
clientId: $props.ticket.clientFk, clientId: $props.ticket.clientFk,
landed: newTicketFormData.landed, landed: newTicketFormData.landed,
@ -51,9 +48,6 @@ const createTicket = async () => {
const { data } = await axios.post('Expeditions/moveExpeditions', params); const { data } = await axios.post('Expeditions/moveExpeditions', params);
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
router.push({ name: 'TicketSummary', params: { id: data.id } }); router.push({ name: 'TicketSummary', params: { id: data.id } });
} catch (error) {
console.error(error);
}
}; };
</script> </script>

View File

@ -150,31 +150,19 @@ const getTotal = computed(() => {
}); });
const getComponentsSum = async () => { const getComponentsSum = async () => {
try {
const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`); const { data } = await axios.get(`Tickets/${route.params.id}/getComponentsSum`);
componentsList.value = data; componentsList.value = data;
} catch (error) {
console.error(error);
}
}; };
const getTheoricalCost = async () => { const getTheoricalCost = async () => {
try {
const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`); const { data } = await axios.get(`Tickets/${route.params.id}/freightCost`);
theoricalCost.value = data; theoricalCost.value = data;
} catch (error) {
console.error(error);
}
}; };
const getTicketVolume = async () => { const getTicketVolume = async () => {
try {
if (!ticketData.value) return; if (!ticketData.value) return;
const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`); const { data } = await axios.get(`Tickets/${ticketData.value.id}/getVolume`);
ticketVolume.value = data[0].volume; ticketVolume.value = data[0].volume;
} catch (error) {
console.error(error);
}
}; };
onMounted(() => { onMounted(() => {

View File

@ -187,18 +187,12 @@ const showNewTicketDialog = (withRoute = false) => {
}; };
const deleteExpedition = async () => { const deleteExpedition = async () => {
try { const expeditionIds = selectedExpeditions.value.map((expedition) => expedition.id);
const expeditionIds = selectedExpeditions.value.map(
(expedition) => expedition.id
);
const params = { expeditionIds }; const params = { expeditionIds };
await axios.post('Expeditions/deleteExpeditions', params); await axios.post('Expeditions/deleteExpeditions', params);
await refetchExpeditions(); await refetchExpeditions();
selectedExpeditions.value = []; selectedExpeditions.value = [];
notify(t('expedition.expeditionRemoved'), 'positive'); notify(t('expedition.expeditionRemoved'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const showLog = async (expedition) => { const showLog = async (expedition) => {
@ -207,7 +201,6 @@ const showLog = async (expedition) => {
}; };
const getExpeditionState = async (expedition) => { const getExpeditionState = async (expedition) => {
try {
const filter = { const filter = {
where: { expeditionFk: expedition.id }, where: { expeditionFk: expedition.id },
order: ['created DESC'], order: ['created DESC'],
@ -227,9 +220,6 @@ const getExpeditionState = async (expedition) => {
isScanned: scannedState ? scannedState.isScanned : false, isScanned: scannedState ? scannedState.isScanned : false,
}; };
}); });
} catch (error) {
console.error(error);
}
}; };
onMounted(async () => { onMounted(async () => {

View File

@ -165,14 +165,10 @@ const createRefund = async (withWarehouse) => {
negative: true, negative: true,
}; };
try {
const { data } = await axios.post('Tickets/cloneAll', params); const { data } = await axios.post('Tickets/cloneAll', params);
const [refundTicket] = data; const [refundTicket] = data;
notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive'); notify(t('refundTicketCreated', { ticketId: refundTicket.id }), 'positive');
push({ name: 'TicketSale', params: { id: refundTicket.id } }); push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) {
console.error(error);
}
}; };
</script> </script>

View File

@ -150,7 +150,6 @@ const shelvingsTableColumns = computed(() => [
]); ]);
const getSaleTrackings = async (sale) => { const getSaleTrackings = async (sale) => {
try {
const filter = { const filter = {
where: { saleFk: sale.saleFk }, where: { saleFk: sale.saleFk },
order: ['itemFk DESC'], order: ['itemFk DESC'],
@ -159,9 +158,6 @@ const getSaleTrackings = async (sale) => {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
}); });
saleTrackings.value = data; saleTrackings.value = data;
} catch (error) {
console.error(error);
}
}; };
const showLog = async (sale) => { const showLog = async (sale) => {
@ -170,7 +166,6 @@ const showLog = async (sale) => {
}; };
const getItemShelvingSales = async (sale) => { const getItemShelvingSales = async (sale) => {
try {
const filter = { const filter = {
where: { saleFk: sale.saleFk }, where: { saleFk: sale.saleFk },
}; };
@ -178,9 +173,6 @@ const getItemShelvingSales = async (sale) => {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
}); });
itemShelvingsSales.value = data; itemShelvingsSales.value = data;
} catch (error) {
console.error(error);
}
}; };
const showShelving = async (sale) => { const showShelving = async (sale) => {
@ -189,20 +181,15 @@ const showShelving = async (sale) => {
}; };
const updateQuantity = async (sale) => { const updateQuantity = async (sale) => {
try {
if (oldQuantity.value === sale.quantity) return; if (oldQuantity.value === sale.quantity) return;
const params = { const params = {
quantity: sale.quantity, quantity: sale.quantity,
}; };
await axios.patch(`ItemShelvingSales/${sale.id}`, params); await axios.patch(`ItemShelvingSales/${sale.id}`, params);
oldQuantity.value = null; oldQuantity.value = null;
} catch (error) {
console.error(error);
}
}; };
const updateParking = async (sale) => { const updateParking = async (sale) => {
try {
const filter = { const filter = {
fields: ['id'], fields: ['id'],
where: { where: {
@ -216,9 +203,6 @@ const updateParking = async (sale) => {
parkingFk: sale.parkingFk, parkingFk: sale.parkingFk,
}; };
await axios.patch(`Shelvings/${data.id}`, params); await axios.patch(`Shelvings/${data.id}`, params);
} catch (error) {
console.error(error);
}
}; };
const updateShelving = async (sale) => { const updateShelving = async (sale) => {
@ -241,7 +225,6 @@ const updateShelving = async (sale) => {
}; };
const saleTrackingNew = async (sale, stateCode, isChecked) => { const saleTrackingNew = async (sale, stateCode, isChecked) => {
try {
const params = { const params = {
saleFk: sale.saleFk, saleFk: sale.saleFk,
isChecked, isChecked,
@ -250,52 +233,33 @@ const saleTrackingNew = async (sale, stateCode, isChecked) => {
}; };
await axios.post(`SaleTrackings/new`, params); await axios.post(`SaleTrackings/new`, params);
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const saleTrackingDel = async ({ saleFk }, stateCode) => { const saleTrackingDel = async ({ saleFk }, stateCode) => {
try {
const params = { const params = {
saleFk, saleFk,
stateCodes: [stateCode], stateCodes: [stateCode],
}; };
await axios.post(`SaleTrackings/delete`, params); await axios.post(`SaleTrackings/delete`, params);
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const clickSaleGroupDetail = async (sale) => { const clickSaleGroupDetail = async (sale) => {
try {
if (!sale.saleGroupDetailFk) return; if (!sale.saleGroupDetailFk) return;
await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`); await axios.delete(`SaleGroupDetails/${sale.saleGroupDetailFk}`);
sale.hasSaleGroupDetail = false; sale.hasSaleGroupDetail = false;
notify(t('globals.dataSaved'), 'positive'); notify(t('globals.dataSaved'), 'positive');
} catch (error) {
console.error(error);
}
}; };
const clickPreviousSelected = (sale) => { const clickPreviousSelected = (sale) => {
try {
qCheckBoxController(sale, 'isPreviousSelected'); qCheckBoxController(sale, 'isPreviousSelected');
if (!sale.isPreviousSelected) sale.isPrevious = false; if (!sale.isPreviousSelected) sale.isPrevious = false;
} catch (error) {
console.error(error);
}
}; };
const clickPrevious = (sale) => { const clickPrevious = (sale) => {
try {
qCheckBoxController(sale, 'isPrevious'); qCheckBoxController(sale, 'isPrevious');
if (sale.isPrevious) sale.isPreviousSelected = true; if (sale.isPrevious) sale.isPreviousSelected = true;
} catch (error) {
console.error(error);
}
}; };
const qCheckBoxController = (sale, action) => { const qCheckBoxController = (sale, action) => {
@ -306,7 +270,6 @@ const qCheckBoxController = (sale, action) => {
isPreviousSelected: 'PREVIOUS_PREPARATION', isPreviousSelected: 'PREVIOUS_PREPARATION',
}; };
const stateCode = STATE_CODES[action]; const stateCode = STATE_CODES[action];
try {
if (!sale[action]) { if (!sale[action]) {
saleTrackingNew(sale, stateCode, true); saleTrackingNew(sale, stateCode, true);
sale[action] = true; sale[action] = true;
@ -314,9 +277,6 @@ const qCheckBoxController = (sale, action) => {
saleTrackingDel(sale, stateCode); saleTrackingDel(sale, stateCode);
sale[action] = false; sale[action] = false;
} }
} catch (error) {
console.error(error);
}
}; };
</script> </script>

View File

@ -46,7 +46,6 @@ watch(
onMounted(async () => await getDefaultTaxClass()); onMounted(async () => await getDefaultTaxClass());
const createRefund = async () => { const createRefund = async () => {
try {
if (!selected.value.length) return; if (!selected.value.length) return;
const params = { const params = {
@ -63,13 +62,9 @@ const createRefund = async () => {
'positive' 'positive'
); );
router.push({ name: 'TicketSale', params: { id: refundTicket.id } }); router.push({ name: 'TicketSale', params: { id: refundTicket.id } });
} catch (error) {
console.error(error);
}
}; };
const getDefaultTaxClass = async () => { const getDefaultTaxClass = async () => {
try {
let filter = { let filter = {
where: { code: 'G' }, where: { code: 'G' },
}; };
@ -77,9 +72,6 @@ const getDefaultTaxClass = async () => {
params: { filter: JSON.stringify(filter) }, params: { filter: JSON.stringify(filter) },
}); });
defaultTaxClass.value = data; defaultTaxClass.value = data;
} catch (error) {
console.error(error);
}
}; };
const columns = computed(() => [ const columns = computed(() => [

View File

@ -75,7 +75,6 @@ const columns = computed(() => [
]); ]);
const applyVolumes = async (salesData) => { const applyVolumes = async (salesData) => {
try {
if (!salesData.length) return; if (!salesData.length) return;
sales.value = salesData; sales.value = salesData;
@ -88,9 +87,6 @@ const applyVolumes = async (salesData) => {
}); });
packingTypeVolume.value = data.packingTypeVolume; packingTypeVolume.value = data.packingTypeVolume;
} catch (error) {
console.error(error);
}
}; };
onMounted(() => (stateStore.rightDrawer = true)); onMounted(() => (stateStore.rightDrawer = true));

View File

@ -27,7 +27,6 @@ const warehousesOptions = ref([]);
const itemPackingTypes = ref([]); const itemPackingTypes = ref([]);
const getItemPackingTypes = async () => { const getItemPackingTypes = async () => {
try {
const filter = { const filter = {
where: { isActive: true }, where: { isActive: true },
}; };
@ -38,9 +37,6 @@ const getItemPackingTypes = async () => {
description: t(ipt.description), description: t(ipt.description),
code: ipt.code, code: ipt.code,
})); }));
} catch (error) {
console.error(error);
}
}; };
onMounted(async () => await getItemPackingTypes()); onMounted(async () => await getItemPackingTypes());

View File

@ -24,7 +24,6 @@ const itemPackingTypes = ref([]);
const stateOptions = ref([]); const stateOptions = ref([]);
const getItemPackingTypes = async () => { const getItemPackingTypes = async () => {
try {
const filter = { const filter = {
where: { isActive: true }, where: { isActive: true },
}; };
@ -35,22 +34,15 @@ const getItemPackingTypes = async () => {
description: t(ipt.description), description: t(ipt.description),
code: ipt.code, code: ipt.code,
})); }));
} catch (error) {
console.error(error);
}
}; };
const getGroupedStates = async () => { const getGroupedStates = async () => {
try {
const { data } = await axios.get('AlertLevels'); const { data } = await axios.get('AlertLevels');
stateOptions.value = data.map((state) => ({ stateOptions.value = data.map((state) => ({
id: state.id, id: state.id,
name: t(`futureTickets.${state.code}`), name: t(`futureTickets.${state.code}`),
code: state.code, code: state.code,
})); }));
} catch (error) {
console.error(error);
}
}; };
onMounted(async () => { onMounted(async () => {