From 59c32ef8d8dfd62b45683096c394c61b3f867622 Mon Sep 17 00:00:00 2001 From: florianfederspiel Date: Thu, 9 Oct 2025 18:29:24 +0200 Subject: [PATCH] Fixed Load of existing Doc without Created_by --- pages/createDocument/edit/[[id]].vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/createDocument/edit/[[id]].vue b/pages/createDocument/edit/[[id]].vue index 68c444b..f4d86af 100644 --- a/pages/createDocument/edit/[[id]].vue +++ b/pages/createDocument/edit/[[id]].vue @@ -485,14 +485,15 @@ const setCustomerData = async (customerId, loadOnlyAdress = false) => { const setContactPersonData = async () => { //console.log(itemInfo.value.contactPerson) //TODO: BACKEND CHANGE Set Profile - let profile = (await useNuxtApp().$api(`/api/user/${itemInfo.value.created_by}`, { - method: "GET" - })).profile - - itemInfo.value.contactPersonName = profile.full_name - itemInfo.value.contactTel = profile.mobile_tel || profile.fixed_tel || "" - itemInfo.value.contactEMail = profile.email + if(itemInfo.value.created_by) { + let profile = (await useNuxtApp().$api(`/api/user/${itemInfo.value.created_by}`, { + method: "GET" + })).profile + itemInfo.value.contactPersonName = profile.full_name + itemInfo.value.contactTel = profile.mobile_tel || profile.fixed_tel || "" + itemInfo.value.contactEMail = profile.email + } } const showAdvanceInvoiceCalcModal = ref(false)