Skip to content

Commit

Permalink
IMN-839 Return false if certified attributes is empty (#1033)
Browse files Browse the repository at this point in the history
Co-authored-by: Vittorio Caprio <[email protected]>
  • Loading branch information
sandrotaje and Viktor-K authored Sep 30, 2024
1 parent 647c243 commit 91ef664
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ const attributesSatisfied = (
descriptorAttributes: EServiceAttribute[][],
consumerAttributeIds: Array<TenantAttribute["id"]>
): boolean =>
descriptorAttributes.every((attributeList) => {
const attributes = attributeList.map((a) => a.id);
return (
attributes.filter((a) => consumerAttributeIds.includes(a)).length > 0
);
});
descriptorAttributes
.filter((attGroup) => attGroup.length > 0)
.every((attributeList) => {
const attributes = attributeList.map((a) => a.id);
return (
attributes.filter((a) => consumerAttributeIds.includes(a)).length > 0
);
});

export const certifiedAttributesSatisfied = (
descriptor: DescriptorWithOnlyAttributes,
Expand Down

0 comments on commit 91ef664

Please sign in to comment.