Skip to content

Commit

Permalink
fix: show context correctly in list objects viewer (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Mar 6, 2024
1 parent 6ec00bf commit 8235951
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/Docs/SnippetViewer/ListObjectsRequestViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ function listObjectsRequestViewer(lang: SupportedLanguage, opts: ListObjectsRequ
return `curl -X POST $FGA_SERVER_URL/stores/$FGA_STORE_ID/list-objects \\
-H "Authorization: Bearer $FGA_API_TOKEN" \\ # Not needed if service does not require authorization
-H "content-type: application/json" \\
-d '{ "authorization_model_id": "${modelId}",
-d '{
"authorization_model_id": "${modelId}",
"type": "${objectType}",
"relation": "${relation}",
"user":"${user}"${
Expand All @@ -53,15 +54,15 @@ function listObjectsRequestViewer(lang: SupportedLanguage, opts: ListObjectsRequ
)
.join(',')}
]
}`
: ''
}${
context
? `,
"context":${JSON.stringify(context)},`
: ''
}
}'`
"context":${JSON.stringify(context)}`
: ''
}
}'
# Response: {"objects": [${expectedResults.map((r) => `"${r}"`).join(', ')}]}`;
Expand Down

0 comments on commit 8235951

Please sign in to comment.