diff --git a/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js b/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js index 7f9f9b653..b1efb5bb8 100644 --- a/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js +++ b/public/js/pages/WarehouseShippingNote/WarehouseShippingNoteModal.js @@ -260,13 +260,10 @@ Vue.component('warehouse-shipping-note-modal', { return window.notify('error', 'Mindestens eine Position oder eine Stundenbuchung sind erforderlich'); } - if (this.availableTypes.find(t => t.text === this.shippingNote.type)) { - this.shippingNote.type = this.availableTypes.find(t => t.name === this.shippingNote.type).value; - } + const foundType = this.availableTypes.find(t => t.text === this.shippingNote.type); + if (foundType) this.shippingNote.type = foundType?.value; - if (newStatus !== null) { - this.shippingNote.status = newStatus; - } + if (newStatus !== null) this.shippingNote.status = newStatus; const response = await axios.post(`${window.TT_CONFIG["BASE_PATH"]}/WarehouseShippingNote/${this.id === 'create' ? 'create' : 'update'}`, this.shippingNote);