Skip to content

Commit 16539ab

Browse files
committed
check that we have our purchase orders before trying to configure them
1 parent 0fe29f1 commit 16539ab

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/api/requests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export const getAllPOs = async (quotedWareId, uuid, requestIdentifier, accessTok
6363
// This hook is actively being contributed to the swr repo, but the semantics of the work are still being debated.
6464
// See https://github.com/vercel/swr/discussions/1988 for the RFC and https://github.com/vercel/swr/pull/2047 for the PR.
6565
const data = await fetcher(`quote_groups/${uuid}/quoted_wares/${quotedWareId}/purchase_orders.json`, accessToken)
66-
const configuredPOs = data.map(async (po) => {
66+
const configuredPOs = data?.map(async (po) => {
6767
const purchaseOrder = await fetcher(`quote_groups/${uuid}/quoted_wares/${quotedWareId}/purchase_orders/${po.id}.json`, accessToken)
6868
return configurePO(purchaseOrder, requestIdentifier)
6969
})

0 commit comments

Comments
 (0)