how to get StandAlone model in before hook to include it in context and how to mention muliple associated models in include

141 views Asked by At

how to get StandAlone model in before hook to include it in context and how to mention muliple associated models in 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;
            },
1

There are 1 answers

0
Awais Mushtaq On

Found this solution on slack community

const AssociatedModelMunitionDescription = app.get('sequelizeClient').models.munitionDescription;