From 5316b0f5d8d6372c7a042a561fb8c8564dc6d46e Mon Sep 17 00:00:00 2001 From: Jim Anderson Date: Fri, 10 Jan 2025 12:10:39 -0600 Subject: [PATCH] server batch check - update example for response change --- config/clients/js/template/example/example1/example1.mjs | 4 ++-- .../js/template/example/opentelemetry/opentelemetry.mjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/clients/js/template/example/example1/example1.mjs b/config/clients/js/template/example/example1/example1.mjs index 521040e9..dae177fc 100644 --- a/config/clients/js/template/example/example1/example1.mjs +++ b/config/clients/js/template/example/example1/example1.mjs @@ -188,7 +188,7 @@ async function main () { // execute a batch check const anneCorrelationId = randomUUID(); - const { responses } = await fgaClient.batchCheck({ + const { result } = await fgaClient.batchCheck({ checks: [ { // should have access @@ -209,7 +209,7 @@ async function main () { ] }); - const anneAllowed = responses.filter(r => r.correlationId === anneCorrelationId); + const anneAllowed = result.filter(r => r.correlationId === anneCorrelationId); console.log(`Anne is allowed access to ${anneAllowed.length} documents`); anneAllowed.forEach(item => { console.log(`Anne is allowed access to ${item.request.object}`); diff --git a/config/clients/js/template/example/opentelemetry/opentelemetry.mjs b/config/clients/js/template/example/opentelemetry/opentelemetry.mjs index 2414f154..c29fbe47 100644 --- a/config/clients/js/template/example/opentelemetry/opentelemetry.mjs +++ b/config/clients/js/template/example/opentelemetry/opentelemetry.mjs @@ -101,7 +101,7 @@ async function main () { } console.log("Calling BatcCheck") - const { responses } = await fgaClient.batchCheck({ + await fgaClient.batchCheck({ checks: [ { object: "doc:roadmap",