diff --git a/test/helpers/api-integration/api-classes.js b/test/helpers/api-integration/api-classes.js index 79cb3163bdf..097c3594272 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 4782164d82a..3457a390af2 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;