Skip to content

Commit

Permalink
server batch check - update example for response change
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmyjames committed Jan 10, 2025
1 parent 5ecf50b commit 5316b0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config/clients/js/template/example/example1/example1.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ async function main () {
}

console.log("Calling BatcCheck")
const { responses } = await fgaClient.batchCheck({
await fgaClient.batchCheck({
checks: [
{
object: "doc:roadmap",
Expand Down

0 comments on commit 5316b0f

Please sign in to comment.