0
0
Fork 0

refactor: refs #6346 requested changes

This commit is contained in:
Jon Elias 2024-09-10 08:01:28 +02:00
parent e702e9d1a1
commit e1adb1a8dd
2 changed files with 7 additions and 5 deletions

View File

@ -39,7 +39,7 @@ watch(wagonColors, () => {
const emit = defineEmits(['onSubmit']); const emit = defineEmits(['onSubmit']);
async function getTrays() { async function getTrays() {
const data = await axios.get('WagonTypeTrays', undefined, { const { data } = await axios.get('WagonTypeTrays', undefined, {
filter: { wagonTypeFk: entityId.value }, filter: { wagonTypeFk: entityId.value },
}); });
existingTrayHeight.value = data.data.filter( existingTrayHeight.value = data.data.filter(
@ -49,13 +49,11 @@ async function getTrays() {
} }
function onSubmit() { function onSubmit() {
const newTray = { emit('onSubmit', {
wagonTypeFk: entityId.value, wagonTypeFk: entityId.value,
wagonTypeColorFk: selectedTrayColor.value, wagonTypeColorFk: selectedTrayColor.value,
height: trayHeight.value, height: trayHeight.value,
}; });
emit('onSubmit', newTray);
} }
getTrays(); getTrays();
</script> </script>

View File

@ -56,6 +56,10 @@ async function deleteTray(trayToDelete) {
type: 'positive', type: 'positive',
}); });
} catch (err) { } catch (err) {
notify({
message: t('Error deleting tray'),
type: 'negative',
});
console.log('err: ', err); console.log('err: ', err);
} }
} }