Re: [loopbackjs] findById resource not found: Return 404 rather than 204 response code

8 views
Skip to first unread message

Heath Morrison

unread,
Dec 2, 2016, 12:25:30 PM12/2/16
to LoopbackJS
Hi Paddy,

For models based on PersistedModel findById should already return 404s when a record is not found. You mean the API route at /api/YourModels/bogusInstanceId, right?

On Fri, Dec 2, 2016 at 6:54 PM Paddy Mann <pa...@spidergap.com> wrote:
My application expects 404 response codes rather than 204 if a resource isn't found.

I'm of the opinion that this is the correct way to do it (and this appears to be the majority consensus though some disagree).

Anyone attempted this change? Or guidance on where best to implement this change so it affects all findById requests?

Thanks :)

--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/7fab4683-cd48-46cc-a0cc-a20d1984a3fa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages