.
This commit is contained in:
parent
ebd70bdf53
commit
2c8aa9e590
@ -74,7 +74,6 @@ const generateControllers = (service, extraControllers = {}, options = {}) => {
|
||||
//Tratamos resultado, si hay que remover campos para API4 web
|
||||
if (res.locals.v4){
|
||||
const arrayFieldsremove = res.locals.v4.removeFields;
|
||||
console.log('>>>>>>>>>>>>>>>>>>>>>>', result);
|
||||
arrayFieldsremove.forEach(campo => {
|
||||
if (campo in result) {
|
||||
delete result[campo];
|
||||
|
||||
@ -104,6 +104,17 @@ const extraControllers = {
|
||||
});
|
||||
}
|
||||
|
||||
//MAPEO SALIDA API4
|
||||
//Tratamos resultado, si hay que remover campos para API4 web
|
||||
if (res.locals.v4){
|
||||
const arrayFieldsremove = res.locals.v4.removeFields;
|
||||
arrayFieldsremove.forEach(campo => {
|
||||
if (campo in result) {
|
||||
delete result[campo];
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
return handleResultResponse(result, null, params, res, result === null ? httpStatus.NOT_FOUND : httpStatus.OK);
|
||||
} catch (error) {
|
||||
return handleErrorResponse(MODULE_NAME, "allowCapacity", error, res);
|
||||
|
||||
@ -208,7 +208,11 @@ routes.get("/web/events/:id/check_capacity",
|
||||
FieldMiddleware.middleware({
|
||||
invalidFields: generalInvalidFields,
|
||||
}),
|
||||
eventController.checkCapacity);
|
||||
(req, res, next) => {
|
||||
res.locals.v4 = {removeFields : ["assistans", "confirmed", "sold_out", "assistans_overflow", "confirmed_overflow", "sold_out_overflou"]};
|
||||
return eventController.checkCapacity(req, res, next);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* @api {get} /api/v4/web/events/:eventId/reservations/:encodedCode Verificar Código de Invitación
|
||||
|
||||
Loading…
Reference in New Issue
Block a user