Fix(crud) include param can be a string or array

This commit is contained in:
Joey Baker 2016-10-26 10:58:50 -07:00
parent 83eadf0929
commit 07176018b7

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);