a
This commit is contained in:
parent
7e6c644a35
commit
2f953e2838
@ -192,6 +192,11 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
model: sequelize.models.EventType,
|
model: sequelize.models.EventType,
|
||||||
as: 'type',
|
as: 'type',
|
||||||
attributes: ['name', 'title'],
|
attributes: ['name', 'title'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
association: 'location',
|
||||||
|
attributes: ['country', 'city'],
|
||||||
|
require:false,
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -367,9 +372,6 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
|
|
||||||
Event.addScope('onlyOfLocation', (location) => {
|
Event.addScope('onlyOfLocation', (location) => {
|
||||||
return {
|
return {
|
||||||
include: [{
|
|
||||||
model: sequelize.models.Location, as: 'location',
|
|
||||||
}],
|
|
||||||
where: { locationId: { [Sequelize.Op.eq]: location } },
|
where: { locationId: { [Sequelize.Op.eq]: location } },
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user