diff --git a/lib/presentations.js b/lib/presentations.js index e129d67..4dcd7b0 100644 --- a/lib/presentations.js +++ b/lib/presentations.js @@ -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};