Fix(crud) include param lookup now works w/plurals #26

Merged
joeybaker merged 3 commits from fix-include into master 2016-10-26 18:42:15 +00:00
Showing only changes of commit 07176018b7 - Show all commits

View File

@ -62,8 +62,9 @@ export default (server, model, { prefix, defaultConfig: config, models: permissi
return params;
}, {});
const validAssociations = joi.string().valid(...modelAssociations);
const associationValidation = {
include: joi.array().items(joi.string().valid(...modelAssociations)),
include: [joi.array().items(validAssociations), validAssociations],
};
const scopes = Object.keys(model.options.scopes);