mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Use location type guard for warehouse access
This commit is contained in:
@@ -324,12 +324,14 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
|
|||||||
PT LUMBUNG TELUR INDONESIA
|
PT LUMBUNG TELUR INDONESIA
|
||||||
</Text>
|
</Text>
|
||||||
<Text>
|
<Text>
|
||||||
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI'
|
{purchaseData?.items?.[0]?.warehouse &&
|
||||||
|
'location' in purchaseData.items[0].warehouse
|
||||||
? purchaseData.items[0].warehouse.location.name
|
? purchaseData.items[0].warehouse.location.name
|
||||||
: '-'}
|
: '-'}
|
||||||
</Text>
|
</Text>
|
||||||
<Text>
|
<Text>
|
||||||
{purchaseData?.items?.[0]?.warehouse.type === 'LOKASI'
|
{purchaseData?.items?.[0]?.warehouse &&
|
||||||
|
'location' in purchaseData.items[0].warehouse
|
||||||
? purchaseData.items[0].warehouse.location.address
|
? purchaseData.items[0].warehouse.location.address
|
||||||
: '-'}
|
: '-'}
|
||||||
</Text>
|
</Text>
|
||||||
@@ -434,7 +436,7 @@ const PurchaseOrderInvoice = ({ data }: PurchaseOrderInvoiceProps) => {
|
|||||||
</View>
|
</View>
|
||||||
<View style={pdfStyles.tableCell}>
|
<View style={pdfStyles.tableCell}>
|
||||||
<Text>
|
<Text>
|
||||||
{item.warehouse?.type === 'LOKASI'
|
{item.warehouse && 'location' in item.warehouse
|
||||||
? item.warehouse.location.address
|
? item.warehouse.location.address
|
||||||
: '-'}
|
: '-'}
|
||||||
</Text>
|
</Text>
|
||||||
|
|||||||
Reference in New Issue
Block a user