diff --git a/modules/events/event.model.js b/modules/events/event.model.js index 7127c22..1f2ba40 100644 --- a/modules/events/event.model.js +++ b/modules/events/event.model.js @@ -192,6 +192,11 @@ module.exports = function (sequelize, DataTypes) { model: sequelize.models.EventType, as: 'type', attributes: ['name', 'title'], + }, + { + association: 'location', + attributes: ['country', 'city'], + require:false, }], }, }); @@ -367,9 +372,6 @@ module.exports = function (sequelize, DataTypes) { Event.addScope('onlyOfLocation', (location) => { return { - include: [{ - model: sequelize.models.Location, as: 'location', - }], where: { locationId: { [Sequelize.Op.eq]: location } }, } });