Fixed a number of bugs; added a few fields.

This commit is contained in:
2022-08-08 22:15:55 -07:00
parent 4560d7203d
commit c96b4a6901
10 changed files with 3791 additions and 160 deletions

View File

@@ -59,13 +59,15 @@ Meteor.methods({
check(assigneeId, String);
check(assigneeType, String);
check(assetId, String);
if(assigneeType !== 'Student' || assigneeType !== 'Staff') {
if(assigneeType !== 'Student' && assigneeType !== 'Staff') {
// Should never happen.
console.error("Error: Received incorrect assignee type in adding an assignment.");
console.error(assigneeType);
}
else if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
AssetAssignments.insert({assetId, assigneeType: assigneeType === "Student" ? 0 : 1, assigneeId});
AssetAssignments.insert({assetId, assigneeType, assigneeId});
}
},
'AssetAssignments.remove'(_id) {