From e1adb1a8dd7c30f7cc764b5f00e2ca0846565ac3 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 10 Sep 2024 08:01:28 +0200 Subject: [PATCH] refactor: refs #6346 requested changes --- src/pages/Wagon/Type/WagonCreateTray.vue | 8 +++----- src/pages/Wagon/Type/WagonTypeEdit.vue | 4 ++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/Wagon/Type/WagonCreateTray.vue b/src/pages/Wagon/Type/WagonCreateTray.vue index c3f8b3847..bb52e747b 100644 --- a/src/pages/Wagon/Type/WagonCreateTray.vue +++ b/src/pages/Wagon/Type/WagonCreateTray.vue @@ -39,7 +39,7 @@ watch(wagonColors, () => { const emit = defineEmits(['onSubmit']); async function getTrays() { - const data = await axios.get('WagonTypeTrays', undefined, { + const { data } = await axios.get('WagonTypeTrays', undefined, { filter: { wagonTypeFk: entityId.value }, }); existingTrayHeight.value = data.data.filter( @@ -49,13 +49,11 @@ async function getTrays() { } function onSubmit() { - const newTray = { + emit('onSubmit', { wagonTypeFk: entityId.value, wagonTypeColorFk: selectedTrayColor.value, height: trayHeight.value, - }; - - emit('onSubmit', newTray); + }); } getTrays(); diff --git a/src/pages/Wagon/Type/WagonTypeEdit.vue b/src/pages/Wagon/Type/WagonTypeEdit.vue index 25ba05714..dc261990f 100644 --- a/src/pages/Wagon/Type/WagonTypeEdit.vue +++ b/src/pages/Wagon/Type/WagonTypeEdit.vue @@ -56,6 +56,10 @@ async function deleteTray(trayToDelete) { type: 'positive', }); } catch (err) { + notify({ + message: t('Error deleting tray'), + type: 'negative', + }); console.log('err: ', err); } }