This commit is contained in:
David Arranz 2019-08-17 14:42:20 +02:00
parent 42a6eefa48
commit 259eb7e02b
3 changed files with 6 additions and 2 deletions

View File

@ -126,7 +126,6 @@ const extraControllers = {
}
},
deleteInscription: async (req, res, next) => {
const params = extractParamsFromRequest(req, res, {});
const user = req.user;

View File

@ -321,6 +321,11 @@ routes.get('/admin/events/:id/partners',
eventController.findPartners,
);
routes.get('/admin/events/:eventId/partners/:entityId/reservations',
// isAdministratorUser,
eventReservationController.find(),
);
routes.post('/admin/reservations',
// isAdministratorUser,

View File

@ -72,7 +72,7 @@ module.exports = function (sequelize, DataTypes) {
EventInscription.associate = function (models) {
EventInscription.Event = EventInscription.belongsTo(models.Event, { foreignKey: 'eventId', as: 'event' });
EventInscription.Reservation = EventInscription.belongsTo(models.EventReservation, { foreignKey: 'reservationId', as: 'reservation', onDelete: 'set null' });
EventInscription.Reservation = EventInscription.belongsTo(models.EventReservation, { foreignKey: 'reservationId', as: 'reservation'});
EventInscription.User = EventInscription.belongsTo(models.User, { foreignKey: 'userId', as: 'user' });
EventInscription.UserValidate = EventInscription.belongsTo(models.User, { foreignKey: 'validateUserId' });
};