From b35bd23c912fef1e87f29b5be4d5bfee6b336d36 Mon Sep 17 00:00:00 2001 From: Joey Baker Date: Sun, 4 Sep 2016 15:33:58 -0700 Subject: [PATCH] Fix: prefer user's config before our own --- src/crud.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/crud.js b/src/crud.js index bf06dc3..66d0867 100644 --- a/src/crud.js +++ b/src/crud.js @@ -110,13 +110,13 @@ export const get = ({ server, model, prefix = '/', config }) => { reply(instance); }, - config: _.defaultsDeep({ + config: _.defaultsDeep(config, { validate: { params: joi.object().keys({ id: joi.any(), }), }, - }, config), + }), }); }; @@ -138,13 +138,13 @@ export const scope = ({ server, model, prefix = '/', config }) => { reply(list); }, - config: _.defaultsDeep({ + config: _.defaultsDeep(config, { validate: { params: joi.object().keys({ scope: joi.string().valid(...scopes), }), }, - }, config), + }), }); }; @@ -225,13 +225,13 @@ export const destroyScope = ({ server, model, prefix = '/', config }) => { reply(list); }, - config: _.defaultsDeep({ + config: _.defaultsDeep(config, { validate: { params: joi.object().keys({ scope: joi.string().valid(...scopes), }), }, - }, config), + }), }); }; @@ -256,11 +256,11 @@ export const update = ({ server, model, prefix = '/', config }) => { reply(instance); }, - config: _.defaultsDeep({ + config: _.defaultsDeep(config, { validate: { payload: joi.object().required(), }, - }, config), + }), }); };