api icon indicating copy to clipboard operation
api copied to clipboard

Bug: add missing pipe validators

Open jpmcb opened this issue 3 months ago • 1 comments

Describe the bug

There are a few places in the Nest controllers where we are missing pipe validators which can cause 500s. For example, in the workspace delete member controller:

https://github.com/open-sauced/api/blob/ecb7657374ece5181863b235f45df69ab86ccedc/src/workspace/workspace-members.controller.ts#L102-L106

providing the id: number as a string will cause a 500 since there's no validator in this flow.

I'm sure there are a few places this is happening that we'll want to add validators in.

Steps to reproduce

  1. Attempt to delete workspace member with a malformed body:
{
  "members": [
    {
      "id": "woofwoof"
    }
  ]
}
  1. notice 500 is thrown

Browsers

No response

Additional context (Is this in dev or production?)

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

Contributing Docs

  • [X] I agree to follow this project's Contribution Docs

jpmcb avatar Mar 13 '24 15:03 jpmcb