Skip to content

Commit

Permalink
Fix VC match filter application.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlongley committed Oct 28, 2024
1 parent 439914f commit 70f42a8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/presentations.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,12 +384,13 @@ async function _getMatches({
for(const result of results) {
const {credentialQuery, matches} = result;

// apply filters:
// remove any matches that do not include the requested context
result.matches = matches.filter(_matchContextFilter({credentialQuery}));

// apply local filters
// FIXME: write generalized matching instead
result.matches = matches.filter(_openBadgeFilter({credentialQuery}));
// match any open badge achievement ID
// FIXME: add more generalized matching
result.matches = matches
.filter(_matchContextFilter({credentialQuery}))
.filter(_openBadgeFilter({credentialQuery}));

// create derived VCs for each match based on specific `credentialQuery`
const updatedQuery = {...vprQuery, credentialQuery};
Expand Down

0 comments on commit 70f42a8

Please sign in to comment.