From 46dfacae23c07cef62e6c45dad96203462ee59b9 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 31 Dec 2025 11:53:40 +0700 Subject: [PATCH 1/3] refactor(FE-Fix): Use optional chaining for expedition vendor name --- src/components/pages/purchase/order/PurchaseOrderDetail.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx index a5d6474b..72f9c474 100644 --- a/src/components/pages/purchase/order/PurchaseOrderDetail.tsx +++ b/src/components/pages/purchase/order/PurchaseOrderDetail.tsx @@ -583,7 +583,7 @@ const PurchaseOrderDetail = ({ { header: 'Ekspedisi', accessorKey: 'expedition_name', - cell: (props) => props.row.original.expedition_vendor.name || '-', + cell: (props) => props.row.original.expedition_vendor?.name || '-', }, { header: 'Transport /Item', From 201c9249cc10a94a3dae530742d7d648e13f8dd4 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 31 Dec 2025 11:58:14 +0700 Subject: [PATCH 2/3] fix(FE): Make expedition_vendor optional and nullable --- src/types/api/purchase/purchase.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/types/api/purchase/purchase.d.ts b/src/types/api/purchase/purchase.d.ts index 7f493d08..2f69c543 100644 --- a/src/types/api/purchase/purchase.d.ts +++ b/src/types/api/purchase/purchase.d.ts @@ -42,12 +42,12 @@ export type PurchaseItem = { expedition_vendor_name?: string | null; received_qty?: number | null; transport_per_item?: number | null; - expedition_vendor: { + expedition_vendor?: { id: number; name: string; alias: string; category: string; - }; + } | null; }; export type BasePurchase = { From 37317ed95c1e0f82ac9b6bc274024678d8348e84 Mon Sep 17 00:00:00 2001 From: rstubryan Date: Wed, 31 Dec 2025 11:58:45 +0700 Subject: [PATCH 3/3] fix(FE): Make expedition_vendor optional and nullable --- src/types/api/purchase/purchase.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types/api/purchase/purchase.d.ts b/src/types/api/purchase/purchase.d.ts index 2f69c543..4e717f15 100644 --- a/src/types/api/purchase/purchase.d.ts +++ b/src/types/api/purchase/purchase.d.ts @@ -43,10 +43,10 @@ export type PurchaseItem = { received_qty?: number | null; transport_per_item?: number | null; expedition_vendor?: { - id: number; - name: string; - alias: string; - category: string; + id?: number; + name?: string; + alias?: string; + category?: string; } | null; };