refactor(db-schema): group.isSubscribed() method name changed to group.hasActiveGroupPlan()

This commit is contained in:
hamboomger
2020-03-26 19:31:07 +02:00
parent e4661c3763
commit 00d12e83bd
7 changed files with 19 additions and 17 deletions

View File

@@ -477,13 +477,13 @@ schema.methods.canGetGems = async function canObtainGems () {
const groups = await getUserGroupData(user);
return groups
.every(g => !g.isSubscribed() || g.leader === user._id || g.leaderOnly.getGems !== true);
.every(g => !g.hasActiveGroupPlan() || g.leader === user._id || g.leaderOnly.getGems !== true);
};
schema.methods.isMemberOfGroupPlan = async function isMemberOfGroupPlan () {
const groups = await getUserGroupData(this);
return groups.some(g => g.isSubscribed());
return groups.some(g => g.hasActiveGroupPlan());
};
schema.methods.isAdmin = function isAdmin () {