Fix: prefer user's config before our own

This commit is contained in:
Joey Baker 2016-09-04 15:33:58 -07:00
parent b4ea8c5b8e
commit b35bd23c91

View File

@ -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),
}),
});
};