refactor(FE): Guard warehouse before accessing location

This commit is contained in:
rstubryan
2026-01-20 10:07:39 +07:00
parent a538c3ea90
commit 6319b6d5fe
@@ -723,8 +723,8 @@ const PurchaseOrderDetail = ({
</span>
<span className='text-gray-900 ml-3 break-all'>
:{' '}
{purchaseData.items?.[0]?.warehouse?.type === 'LOKASI' &&
purchaseData.items?.[0]?.warehouse?.location?.name
{purchaseData.items?.[0]?.warehouse &&
'location' in purchaseData.items[0].warehouse
? purchaseData.items[0].warehouse.location.name
: '-'}
</span>