Skip to content

Commit 217211b

Browse files
author
Gerald Baulig
committed
fix(meta): surrpess empty entires
1 parent 80546a9 commit 217211b

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

src/service.ts

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,29 +1361,35 @@ export class OrderingService
13611361
)
13621362
);
13631363

1364-
order.meta.owners = [
1365-
...order.meta?.owners,
1366-
!has_shop_as_owner && {
1367-
id: this.urns.ownerIndicatoryEntity,
1368-
value: this.urns.organization,
1369-
attributes: [
1370-
{
1371-
id: this.urns.ownerInstance,
1372-
value: shop.payload.organization_id
1373-
}
1374-
]
1375-
},
1376-
!has_customer_as_owner && {
1377-
id: this.urns.ownerIndicatoryEntity,
1378-
value: customer_entity,
1379-
attributes: [
1380-
{
1381-
id: this.urns.ownerInstance,
1382-
value: customer_instance
1383-
}
1384-
]
1385-
}
1386-
];
1364+
if (!has_shop_as_owner ) {
1365+
order.meta.owners.push(
1366+
{
1367+
id: this.urns.ownerIndicatoryEntity,
1368+
value: this.urns.organization,
1369+
attributes: [
1370+
{
1371+
id: this.urns.ownerInstance,
1372+
value: shop.payload.organization_id
1373+
}
1374+
]
1375+
}
1376+
);
1377+
}
1378+
1379+
if (!has_customer_as_owner ) {
1380+
order.meta.owners.push(
1381+
{
1382+
id: this.urns.ownerIndicatoryEntity,
1383+
value: customer_entity,
1384+
attributes: [
1385+
{
1386+
id: this.urns.ownerInstance,
1387+
value: customer_instance
1388+
}
1389+
]
1390+
}
1391+
);
1392+
};
13871393

13881394
return {
13891395
payload: order,

0 commit comments

Comments
 (0)