a
This commit is contained in:
parent
4af14ffb22
commit
b61fd6cffb
@ -14,7 +14,6 @@ const citiesComposer = (city) => {
|
||||
}
|
||||
|
||||
const commentComposer = (comment, context) => {
|
||||
|
||||
if (comment.user) {
|
||||
comment.user_name = comment.user.name + '---';
|
||||
comment.profile_picture = cdnHelper.getCDNMediaUrl(comment.user.profile_picture);
|
||||
|
||||
@ -57,6 +57,16 @@ routes.get('/comments/speakers',
|
||||
*********************************************************************************************************
|
||||
*/
|
||||
|
||||
routes.get('/admin/comments/events/:entityId',
|
||||
isAdministratorUser,
|
||||
// PaginateMiddleware.middleware(),
|
||||
SortMiddleware.middleware({ default: "createdAt" }),
|
||||
commentController.find({
|
||||
scopes: ['defaultScope', 'onlyEvents'],
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
// Borrado
|
||||
routes.delete('/admin/comments/:id',
|
||||
isAdministratorUser,
|
||||
|
||||
@ -475,9 +475,10 @@ console.log(mailOptions);
|
||||
getReservationsExcel: async (req, res, next) => {
|
||||
const params = extractParamsFromRequest(req, res, {});
|
||||
const eventId = params.params.id;
|
||||
const type = params.params.type;
|
||||
const userId = req.user.id;
|
||||
|
||||
const reservations = await eventReservationService._getReservationsExcel(req.user, eventId, null, function(result, status){
|
||||
const reservations = await eventReservationService._getReservationsExcel(req.user, eventId, null, type, function(result, status){
|
||||
if (result.messenger.code == "S99001") {
|
||||
console.log(result);
|
||||
res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||
|
||||
@ -337,12 +337,7 @@ routes.get('/admin/events/:id/reservations/excel',
|
||||
eventController.getReservationsExcel,
|
||||
);
|
||||
|
||||
routes.get('/admin/events/:id/reservations/partners/excel',
|
||||
isAdministratorUser,
|
||||
eventController.getReservationsExcel,
|
||||
);
|
||||
|
||||
routes.get('/admin/events/:id/reservations/colleges/excel',
|
||||
routes.get('/admin/events/:id/reservations/:type/excel',
|
||||
isAdministratorUser,
|
||||
eventController.getReservationsExcel,
|
||||
);
|
||||
|
||||
@ -79,7 +79,15 @@ const extraMethods = {
|
||||
});
|
||||
},
|
||||
|
||||
_getReservationsExcel: (user, eventId, partnerId, callback) => {
|
||||
_getReservationsExcel: (user, eventId, partnerId, type, callback) => {
|
||||
console.log('>>>>>>>>>>>>>>>>>>>><consulta con type:', type);
|
||||
|
||||
var whereType = {};
|
||||
if (type == 'partners')
|
||||
whereType = { alias: 'partner'}
|
||||
else if (type == 'colleges')
|
||||
whereType = { alias: 'college' };
|
||||
|
||||
models.EventReservation.findAll({
|
||||
where: {
|
||||
eventId: eventId,
|
||||
@ -89,6 +97,7 @@ const extraMethods = {
|
||||
attributes: ['id', 'name'],
|
||||
}, {
|
||||
model: models.Entity,
|
||||
include: [{ model: models.EntityType, as: 'types', where: whereType }]
|
||||
},
|
||||
{
|
||||
model: models.EventInscription,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user