From 11e6ff596c07414b18bbd8884981bafb7d70c531 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Fri, 28 Oct 2016 11:20:59 -0700 Subject: [PATCH] Fix(crud) scope now 404s on no results --- src/crud.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/crud.js b/src/crud.js index 32cc61a..1f02710 100644 --- a/src/crud.js +++ b/src/crud.js @@ -214,6 +214,8 @@ export const scope = ({ server, model, prefix = '/', config }) => { include, where, limit, offset, order, }); + if (!list.length) return void reply(notFound('Nothing found.')); + reply(list.map((item) => item.toJSON())); }, config,