I want to do inner join using sequelize ORM and it is working fine. But here it is returning in a nested object. How can we convert into a single object?
const caseProtaluserList = await models.Cases.findAll({include: [
{
model: models.Merchants,
attributes: ['name']
}
]
output
{
"case_Id": "1",
"merchantId": 1,
"primary_Email": "addad",
"description": "dadad",
"status": "dada",
"createdAt": "2020-02-05T09:29:20.000Z",
"updatedAt": "2020-02-05T09:29:20.000Z",
"Merchant": {
"name": "Waterstone Brands"
}
}