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