fix(buyer-tasks): type-safe expand traversal for customer/company
Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
parent
463917d755
commit
49acc04fd1
1 changed files with 3 additions and 3 deletions
|
|
@ -68,9 +68,9 @@ export async function listBuyerTasks(tab: BuyerTaskTab): Promise<BuyerTaskGroup[
|
|||
if (!group) {
|
||||
const order = item.expand?.order as { order_number?: string } | undefined;
|
||||
const supplier = item.expand?.supplier as { suppliername?: string } | undefined;
|
||||
const customer = (item.expand?.order as { customer?: unknown } | undefined)
|
||||
?.expand?.customer as { customer?: string } | undefined;
|
||||
const company = (customer?.expand?.company as { company?: string } | undefined)
|
||||
const customer = (item.expand?.order as { expand?: { customer?: { customer?: string; expand?: { company?: { company?: string } } } } })
|
||||
?.expand?.customer;
|
||||
const company = customer?.expand?.company
|
||||
?? (item.expand?.order as { expand?: { company?: { company?: string } } })?.expand?.company;
|
||||
|
||||
group = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue