forked from verdnatura/salix-front
refactor: refs #6346 requested changes
This commit is contained in:
parent
e702e9d1a1
commit
e1adb1a8dd
|
@ -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>
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue