mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-20 04:38:55 +00:00
fix(groups): fix TypeError when missing
This commit is contained in:
parent
bccfaab350
commit
8b3267458b
1 changed files with 1 additions and 1 deletions
|
|
@ -75,10 +75,10 @@ api.getChat = {
|
|||
|
||||
const { groupId } = req.params;
|
||||
const group = await Group.getGroup({ user, groupId, fields: 'chat privacy' });
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
if (group.privacy === 'public') {
|
||||
throw new BadRequest(res.t('featureRetired'));
|
||||
}
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
const groupChat = await Group.toJSONCleanChat(group, user);
|
||||
res.respond(200, groupChat.chat);
|
||||
|
|
|
|||
Loading…
Reference in a new issue