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 };
|
||||
|
||||
this.update(update, '$push');
|
||||
|
||||
return this;
|
||||
return await this.update(update);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user