Skip to content

Commit

Permalink
fix(meta): surrpess empty entires
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerald Baulig committed Aug 2, 2024
1 parent 80546a9 commit 217211b
Showing 1 changed file with 29 additions and 23 deletions.
52 changes: 29 additions & 23 deletions src/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,29 +1361,35 @@ export class OrderingService
)
);

order.meta.owners = [
...order.meta?.owners,
!has_shop_as_owner && {
id: this.urns.ownerIndicatoryEntity,
value: this.urns.organization,
attributes: [
{
id: this.urns.ownerInstance,
value: shop.payload.organization_id
}
]
},
!has_customer_as_owner && {
id: this.urns.ownerIndicatoryEntity,
value: customer_entity,
attributes: [
{
id: this.urns.ownerInstance,
value: customer_instance
}
]
}
];
if (!has_shop_as_owner ) {
order.meta.owners.push(
{
id: this.urns.ownerIndicatoryEntity,
value: this.urns.organization,
attributes: [
{
id: this.urns.ownerInstance,
value: shop.payload.organization_id
}
]
}
);
}

if (!has_customer_as_owner ) {
order.meta.owners.push(
{
id: this.urns.ownerIndicatoryEntity,
value: customer_entity,
attributes: [
{
id: this.urns.ownerInstance,
value: customer_instance
}
]
}
);
};

return {
payload: order,
Expand Down

0 comments on commit 217211b

Please sign in to comment.