fix tabbing

This commit is contained in:
yamanq 2016-08-08 20:55:02 -04:00
parent e51d35eba9
commit cf7a586cf2

View File

@ -6,12 +6,14 @@ _uuid4 = function(cc) {
return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16); return (cc === 'x' ? rr : (rr & 0x3 | 0x8)).toString(16);
} }
Meteor.methods({ Meteor.methods({
'genCode': function() { 'genCode': function() {
return 'xxxxxx'.replace(/[x]/g, _uuid4); return 'xxxxxx'.replace(/[x]/g, _uuid4);
}, },
//NOT COMPLETE V
'createClass': function(input) { 'createClass': function(input) {
if(Meteor.user() != null && Meteor.classes.find({status:true, admin:Meteor.userId()}).length < 5){ if(Meteor.user() != null && Meteor.classes.find({status:true, admin:Meteor.userId()}).length < 5 &&
schools.find({name:input.school}).fetch().length > 0){
classes.schema.validate(input); classes.schema.validate(input);
classes.insert(input); classes.insert(input);
} }
@ -39,4 +41,4 @@ _uuid4 = function(cc) {
return 0; return 0;
} }
} }
}); });