keyshade-xyz / keyshade

Realtime secret and configuration management tool, with the best in class security and seamless integration support
https://keyshade.xyz
Mozilla Public License 2.0
196 stars 96 forks source link

API: Error while inviting user to workspace #405

Closed rajdip-b closed 1 month ago

rajdip-b commented 2 months ago

Describe the bug

When we try to invite a user to a workspace, and we try to assign them a role ID that doesn't exist, instead of returning a 404 with proper error message, the API throws a 500 error.

To Reproduce Steps to reproduce the behavior:

  1. Create a workspace
  2. Try to invite another user to the workspace and in roleIds array, supply an ID that doesn't exist
  3. Encounter the error

Expected behavior

If a workspace role provided in the roleIds array doesn't exist, we want to return a 404 specifying that the particular role doesn't exist.

Screenshots

Desktop (please complete the following information):

Additional context

We also doubt that the same error will be present in Update member role endpoint aswell.

PriyobrotoKar commented 1 month ago

/attempt

github-actions[bot] commented 1 month ago

Assigned the issue to @PriyobrotoKar!

PriyobrotoKar commented 1 month ago

@rajdip-b does a response like this work?

image

rajdip-b commented 1 month ago

Totally!

P.S. Sorry about the late reply.

PriyobrotoKar commented 1 month ago

No worries at all! I am trying to submit the PR soon, almost done.