Fix: include option api correction
AFAIK, hapi-sequelize doesn't have a `request.models`, but it does have a `request.getDb()` method that has `models` on it. This calls that method to get the related models, but allows `request.models` to keep working for backward compatibility.
This commit is contained in:
@ -31,6 +31,8 @@ export const list = (server, model) => {
|
||||
const include = parseInclude(request);
|
||||
const where = parseWhere(request);
|
||||
|
||||
if (include instanceof Error) return void reply(include);
|
||||
|
||||
const list = await model.findAll({
|
||||
where, include,
|
||||
});
|
||||
|
Reference in New Issue
Block a user