Validate query and payload #20

Merged
joeybaker merged 14 commits from error-on-invalid-where into master 2016-09-06 18:29:40 +00:00
Showing only changes of commit 32a539c3d9 - Show all commits

View File

@ -243,11 +243,7 @@ export const update = ({ server, model, prefix = '/', config }) => {
@error
async handler(request, reply) {
const { id } = request.params;
const instance = await model.findOne({
where: {
id,
},
});
const instance = await model.findById(id);
if (!instance) return void reply(notFound(`${id} not found.`));