kurierjs / kurier

TypeScript framework to create JSON:API compliant APIs
https://kurier.readthedocs.io/en/latest/
MIT License
61 stars 9 forks source link

fix(json-api-express): make sure response status is a number #370

Closed nelson6e65 closed 9 months ago

nelson6e65 commented 10 months ago

Regardless of Error instance has status property as string, convert it to number for res.status().

Fixes #369

nelson6e65 commented 9 months ago

Ah, I remember that type problem, @joelalejandro . That's why I used +. You can use:

Number.parseInt(`${error.status}`, 10)
joelalejandro commented 9 months ago

Nah, haha, this was a readability change, I'd rather keep the + in that case. Reverting that last commit.