matheusgomes28 / urchin

Headless CMS written in Golang
MIT License
60 stars 19 forks source link

Correct return errors from Post endpoints #67

Open matheusgomes28 opened 5 months ago

matheusgomes28 commented 5 months ago

the the main CMS app, the get post endpoints are returning 500 in a few edge cases:

  1. When the post ID passed is negative /posts/-1
  2. When the post ID passed is not an integer /posts/someString
  3. When the post ID passed it not a valid post /posts/10000000

In all those cases, I think we should be returning a Bas Request.

SourabHere commented 5 months ago

Raised a PR solving this issue, please review

I think for the ""/posts/10000000" the status code should be 404 if its not there