From c8c2032183d9a6e31f16819fa8d0783aee800143 Mon Sep 17 00:00:00 2001 From: puriphatt Date: Fri, 29 Nov 2024 09:42:08 +0700 Subject: [PATCH] fix: request list => handle undefined name on table --- src/pages/08_request-list/TableRequestList.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/08_request-list/TableRequestList.vue b/src/pages/08_request-list/TableRequestList.vue index 52538a20..8b04a9cb 100644 --- a/src/pages/08_request-list/TableRequestList.vue +++ b/src/pages/08_request-list/TableRequestList.vue @@ -45,8 +45,8 @@ function getCustomerName( }[opts?.locale || 'eng'], ['PERS']: { - ['eng']: `${useOptionStore().mapOption(customer.namePrefix)} ${customer.firstNameEN} ${customer.lastNameEN}`, - ['tha']: `${useOptionStore().mapOption(customer.namePrefix)} ${customer.firstName} ${customer.lastName}`, + ['eng']: `${useOptionStore().mapOption(customer?.namePrefix)} ${customer?.firstNameEN} ${customer?.lastNameEN}`, + ['tha']: `${useOptionStore().mapOption(customer?.namePrefix)} ${customer?.firstName} ${customer?.lastName}`, }[opts?.locale || 'eng'] || '-', }[customer.customer.customerType] + (opts?.noCode ? '' : ' ' + `(${customer.code})`) @@ -63,8 +63,8 @@ function getEmployeeName( return ( { - ['eng']: `${useOptionStore().mapOption(employee.namePrefix)} ${employee.firstNameEN} ${employee.lastNameEN}`, - ['tha']: `${useOptionStore().mapOption(employee.namePrefix)} ${employee.firstName} ${employee.lastName}`, + ['eng']: `${useOptionStore().mapOption(employee?.namePrefix)} ${employee?.firstNameEN} ${employee?.lastNameEN}`, + ['tha']: `${useOptionStore().mapOption(employee?.namePrefix)} ${employee?.firstName} ${employee?.lastName}`, }[opts?.locale || 'eng'] || '-' ); }