Invite system created, mostly done, but timeboxed for now

This commit is contained in:
Thaum Rystra
2020-05-07 14:52:18 +02:00
parent 4ca47d3a62
commit 31185a4b12
14 changed files with 440 additions and 122 deletions

View File

@@ -1,4 +1,5 @@
import SimpleSchema from 'simpl-schema';
import { ValidatedMethod } from 'meteor/mdg:validated-method';
const userSchema = new SimpleSchema({
username: {
@@ -140,13 +141,3 @@ Meteor.users.findUserByUsernameOrEmail = new ValidatedMethod({
return user && user._id;
}
});
export function getEntitledCentsOfUser(user){
if (!user) return 0;
const patreon = user.services && user.services.patreon;
if (!patreon) return 0;
let entitledCents = patreon.entitledCents || 0;
let overrideCents = patreon.entitledCentsOverride || 0;
if (overrideCents > entitledCents) entitledCents = overrideCents;
return entitledCents;
}