From 2063070f182b2263ede55393aa48fb1c59fcd1ac Mon Sep 17 00:00:00 2001 From: Keith Holliday Date: Sat, 23 Jan 2016 13:41:51 -0600 Subject: [PATCH] Added group toJSON conversion and fixed syntax errors --- test/helpers/api-integration/api-classes.js | 4 +--- website/src/controllers/api-v3/groups.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/test/helpers/api-integration/api-classes.js b/test/helpers/api-integration/api-classes.js index 79cb3163bd..097c359427 100644 --- a/test/helpers/api-integration/api-classes.js +++ b/test/helpers/api-integration/api-classes.js @@ -80,9 +80,7 @@ export class ApiGroup extends ApiObject { let update = { chat }; - this.update(update, '$push'); - - return this; + return await this.update(update); } } diff --git a/website/src/controllers/api-v3/groups.js b/website/src/controllers/api-v3/groups.js index 4782164d82..3457a390af 100644 --- a/website/src/controllers/api-v3/groups.js +++ b/website/src/controllers/api-v3/groups.js @@ -153,6 +153,7 @@ api.getGroup = { if (!group) throw new NotFound(res.t('groupNotFound')); if (!user.contributor.admin) { + group = group.toJSON(); _.remove(group.chat, function removeChat (chat) { chat.flags = {}; return chat.flagCount >= 2;