Merge branch 'master' of wopr.rodax-software.com:lqdvi/app2-api
This commit is contained in:
commit
d055432487
@ -44,7 +44,14 @@ module.exports = function (sequelize, DataTypes) {
|
||||
Entity.EventsReservations = Entity.hasMany(models.EventReservation, { foreignKey: 'entityId', as: 'reservations' });
|
||||
};
|
||||
|
||||
|
||||
Entity.addScope('withEntityTypes', () => {
|
||||
return {
|
||||
include: [{
|
||||
model: sequelize.models.EntityType,
|
||||
as: 'types',
|
||||
}]
|
||||
}
|
||||
});
|
||||
|
||||
Entity.addScope('onlyColleges', () => {
|
||||
return {
|
||||
|
||||
@ -66,7 +66,9 @@ routes.get('/admin/entities/partners/:id',
|
||||
|
||||
routes.get('/admin/entities/:id',
|
||||
//isAdministratorUser,
|
||||
entityController.findOne(),
|
||||
entityController.findOne({
|
||||
scopes: ['withEntityTypes'],
|
||||
}),
|
||||
);
|
||||
|
||||
routes.get('/admin/entitytypes/',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user