diff --git a/agent/src/endpoints.ts b/agent/src/endpoints.ts index 61b0a78..160e641 100644 --- a/agent/src/endpoints.ts +++ b/agent/src/endpoints.ts @@ -198,24 +198,22 @@ apiRouter.post('/offers/receive', async (request: Request, response: Response) = apiRouter.get('/verifier', async (_, response: Response) => { return response.json({ - presentationRequests: verifiers - .filter((v) => 'useCase' in v) - .flatMap((verifier) => [ - ...verifier.presentationRequests.map((c) => { - return { - useCase: verifier.useCase, - display: `${verifier.clientMetadata.client_name} - ${c.name} - DIF PEX`, - id: c.id, - } - }), - ...verifier.dcqlRequests.map((c) => { - return { - useCase: verifier.useCase, - display: `${verifier.clientMetadata.client_name} - ${c.name} - DCQL`, - id: c.id, - } - }), - ]), + presentationRequests: verifiers.flatMap((verifier) => [ + ...verifier.presentationRequests.map((c) => { + return { + useCase: 'useCase' in verifier ? verifier.useCase : undefined, + display: `${verifier.clientMetadata.client_name} - ${c.name} - DIF PEX`, + id: c.id, + } + }), + ...verifier.dcqlRequests.map((c) => { + return { + useCase: 'useCase' in verifier ? verifier.useCase : undefined, + display: `${verifier.clientMetadata.client_name} - ${c.name} - DCQL`, + id: c.id, + } + }), + ]), }) }) diff --git a/agent/src/verifiers/index.ts b/agent/src/verifiers/index.ts index 35c2a46..1d27641 100644 --- a/agent/src/verifiers/index.ts +++ b/agent/src/verifiers/index.ts @@ -22,7 +22,7 @@ export const verifiers = [ farmatecVerifier, pgeuVerifier, europeanUnionVerifier, -] as const +] export const allDefinitions = verifiers.flatMap( ( v