Added the ability to create and edit students and staff. Still cannot delete.

This commit is contained in:
2022-08-21 11:13:19 -07:00
parent 8d4b72c581
commit 23838990d4
4 changed files with 66 additions and 14 deletions

View File

@@ -17,9 +17,14 @@ if (Meteor.isServer) {
});
}
Meteor.methods({
'staff.add'(firstName, lastName, email, siteId) {
'staff.add'(id, firstName, lastName, email, siteId) {
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
Staff.insert({firstName, lastName, email, siteId});
Staff.insert({id, firstName, lastName, email, siteId});
}
},
'staff.update'(_id, id, firstName, lastName, email, siteId) {
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
Staff.update({_id}, {$set: {id, firstName, lastName, email, siteId}});
}
},
'staff.remove'(_id) {