0

如何在钩子之前获取 StandAlone 模型以将其包含在上下文中以及如何在 include 中提及多个关联模型

 context => {
                 const AssociatedModelMunitionFuses = context.app.services.munitionfuses.Model;
                 const AssociatedModelMunitionDescription = //StandAloneModel;
                 context.params.sequelize = {
                 //Require multiple models to include
                 include: [{ model: AssociatedModelMunitionFuses }]
               };
               return context;
            },
4

1 回答 1

0

在 slack 社区找到了这个解决方案

const AssociatedModelMunitionDescription = app.get('sequelizeClient').models.munitionDescription;
于 2018-08-08T17:25:55.530 回答