a
This commit is contained in:
parent
9b0abd08ec
commit
b98aa7f821
@ -266,6 +266,22 @@ module.exports = function (sequelize, DataTypes) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Event.addScope('includeMultimediaAvatar', () => {
|
||||||
|
return {
|
||||||
|
include: [{
|
||||||
|
model: sequelize.models.Multimedia,
|
||||||
|
as: { singular: 'multimedia', plural: 'multimedias' },
|
||||||
|
where: { type: 'avatar'},
|
||||||
|
required: false,
|
||||||
|
include: [{
|
||||||
|
model: sequelize.models.MultimediaFile,
|
||||||
|
as: "multimediaFile"
|
||||||
|
}]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
Event.addScope('includeInscription', (userId) => {
|
Event.addScope('includeInscription', (userId) => {
|
||||||
return {
|
return {
|
||||||
include: [
|
include: [
|
||||||
|
|||||||
@ -35,7 +35,7 @@ routes.get('/events',
|
|||||||
})(req, res, next)
|
})(req, res, next)
|
||||||
else
|
else
|
||||||
return eventController.find({
|
return eventController.find({
|
||||||
scopes: ['defaultScope', 'includeVenue', 'includeMultimedias', 'includeDetails', { method: ['onlyOfLocation', req.body.locationId] }]
|
scopes: ['defaultScope', 'includeVenue', 'includeMultimediaAvatar', 'includeDetails', { method: ['onlyOfLocation', req.body.locationId] }]
|
||||||
})(req, res, next);
|
})(req, res, next);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user