mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
fix(tests): chat related
This commit is contained in:
@@ -129,6 +129,8 @@ api.postChat = {
|
||||
if (validationErrors) throw validationErrors;
|
||||
|
||||
const group = await Group.getGroup({ user, groupId });
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
const { purchased } = group;
|
||||
const isUpgraded = purchased && purchased.plan && purchased.plan.customerId
|
||||
&& (!purchased.plan.dateTerminated || moment().isBefore(purchased.plan.dateTerminated));
|
||||
@@ -175,8 +177,6 @@ api.postChat = {
|
||||
throw new BadRequest(res.t('bannedSlurUsed'));
|
||||
}
|
||||
|
||||
if (!group) throw new NotFound(res.t('groupNotFound'));
|
||||
|
||||
if (group.privacy === 'public' && user.flags.chatRevoked) {
|
||||
throw new NotAuthorized(res.t('chatPrivilegesRevoked'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user