Fix(crud) scope now 404s on no results
This commit is contained in:
parent
6a2290f064
commit
11e6ff596c
@ -214,6 +214,8 @@ export const scope = ({ server, model, prefix = '/', config }) => {
|
|||||||
include, where, limit, offset, order,
|
include, where, limit, offset, order,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!list.length) return void reply(notFound('Nothing found.'));
|
||||||
|
|
||||||
reply(list.map((item) => item.toJSON()));
|
reply(list.map((item) => item.toJSON()));
|
||||||
},
|
},
|
||||||
config,
|
config,
|
||||||
|
Loading…
Reference in New Issue
Block a user