mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Added group toJSON conversion and fixed syntax errors
This commit is contained in:
@@ -80,9 +80,7 @@ export class ApiGroup extends ApiObject {
|
|||||||
|
|
||||||
let update = { chat };
|
let update = { chat };
|
||||||
|
|
||||||
this.update(update, '$push');
|
return await this.update(update);
|
||||||
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ api.getGroup = {
|
|||||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||||
|
|
||||||
if (!user.contributor.admin) {
|
if (!user.contributor.admin) {
|
||||||
|
group = group.toJSON();
|
||||||
_.remove(group.chat, function removeChat (chat) {
|
_.remove(group.chat, function removeChat (chat) {
|
||||||
chat.flags = {};
|
chat.flags = {};
|
||||||
return chat.flagCount >= 2;
|
return chat.flagCount >= 2;
|
||||||
|
|||||||
Reference in New Issue
Block a user