From 27f4ff44f4617f8e026486005e6bd2fec175f301 Mon Sep 17 00:00:00 2001 From: Nitay Rabinovich Date: Sun, 6 May 2018 22:05:17 +0300 Subject: [PATCH] Add if to filter users groups (#957) --- routes/api/api_gate_routes.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/routes/api/api_gate_routes.js b/routes/api/api_gate_routes.js index 81d1a7f97..d4967262d 100644 --- a/routes/api/api_gate_routes.js +++ b/routes/api/api_gate_routes.js @@ -103,11 +103,13 @@ router.post('/get-ticket/', async function (req, res) { if (holder.relations.groups) { _.each(holder.relations.groups.models, group => { // if (groupsMembershipData.contains(group.attributes.group_id)) { - groups.push({ - id: group.attributes.group_id, - type: group.attributes.type, - name: group.attributes.name - }); + if (group.attributes.event_id === req.body.event_id) { + groups.push({ + id: group.attributes.group_id, + type: group.attributes.type, + name: group.attributes.name + }); + } // } }); }