Fix(crud/list) 404 on no results

This commit is contained in:
Joey Baker 2016-11-01 17:39:16 -07:00
parent ce26814f74
commit a335471f02

View File

@ -165,6 +165,8 @@ export const list = ({ server, model, prefix = '/', config }) => {
where, include, limit, offset, order, where, include, limit, offset, order,
}); });
if (!list.length) return void reply(notFound('Nothing found.'));
reply(list.map((item) => item.toJSON())); reply(list.map((item) => item.toJSON()));
}, },