DoSomething / gladiator

:guardsman: The DoSomething.org competitions platform.
2 stars 0 forks source link

Gladiator returns 200 status code, but 422 "code" in JSON. #410

Open DFurnes opened 7 years ago

DFurnes commented 7 years ago

When we handle users who are already in a competition, we imply that the status code is a 422 in the JSON response, but actually still send a plain ol' 200. I actually think this is a good thing (since it's still a successful response!) but something to talk about and potentially update for clarity.

// 200 OK

{
  "error": {
    "code": 422,
    "message": "User Already In Competition"
  }
}
sbsmith86 commented 7 years ago

yea maybe we don't need the code there, just maybe the error object?