fix(tests): subscriptions, group updates

This commit is contained in:
SabreCat
2023-07-28 15:03:56 -05:00
parent f75a4f6982
commit 16be591ed8
6 changed files with 64 additions and 44 deletions

View File

@@ -487,7 +487,9 @@ api.updateGroup = {
if (group.leader !== user._id && group.type === 'party') throw new NotAuthorized(res.t('messageGroupOnlyLeaderCanUpdate'));
else if (group.leader !== user._id && !user.hasPermission('moderator')) throw new NotAuthorized(res.t('messageGroupOnlyLeaderCanUpdate'));
if (req.body.leader !== user._id && group.hasNotCancelled()) throw new NotAuthorized(res.t('cannotChangeLeaderWithActiveGroupPlan'));
if (req.body.leader && req.body.leader !== user._id && group.hasNotCancelled()) {
throw new NotAuthorized(res.t('cannotChangeLeaderWithActiveGroupPlan'));
}
const handleArrays = (currentValue, updatedValue) => {
if (!_.isArray(currentValue)) {