rbac-client doesn't work with an object as a param

Open
#372 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
typescript
Domain
api

Research direction

Start by tracing the TypeScript getWorkspace entry point and how its arguments are converted into the request URL. Reproduce both the inline-argument and params-object calls, then verify that the object form produces the same workspace URL without [object Object].

Written by the indexing model from the issue text.

Description

When using rbac-client, if we send a getWorkspace request using inline arguments:

const workspaceId = `foo-bar-baz`
getWorkspace(workspaceId, true, {})

we get a properly formed URL:

/api/rbac/v2/workspaces/foo-bar-baz/

If we send a request using a params object - which is the style we'd like to use, so to avoid passing optional args to the call - like so:

const workspaceId = `foo-bar-baz`
getWorkspace({ id: workspaceId })

we get a malformed URL:

/api/rbac/v2/workspaces/[object Object]
Dominant language
TypeScript
Stars
7
Forks
37
Avg merge
6d 31m
Merged PRs (30d)
19

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RedHatInsights/javascript-clients

All issues in RedHatInsights/javascript-clients

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.