Removed references to the aggregate code; Commented out the import of the meteor package.

This commit is contained in:
2022-08-14 17:31:34 -07:00
parent cf51200393
commit 071534a420
5 changed files with 26 additions and 46 deletions

View File

@@ -47,13 +47,14 @@ if (Meteor.isServer) {
// This code only runs on the server
Meteor.publish('assetAssignments', function(assetId) {
let query = {};
if(assetId) {
query.assetId = assetId;
}
return AssetAssignments.find(query);
// let query = {};
//
// if(assetId) {
// query.assetId = assetId;
// }
//
// return AssetAssignments.find(query);
return [];
});
}
Meteor.methods({
@@ -69,25 +70,25 @@ Meteor.methods({
* @param assigneeId The Mongo ID of the Student or Staff (person._id).
*/
'AssetAssignments.add'(assetId, assigneeType, assigneeId) {
check(assigneeId, String);
check(assigneeType, String);
check(assetId, String);
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, assigneeId});
}
// check(assigneeId, String);
// check(assigneeType, String);
// check(assetId, String);
//
// 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, assigneeId});
// }
},
'AssetAssignments.remove'(_id) {
check(_id, String);
if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
//TODO: Need to first verify there are no checked out assets to the staff member.
}
// check(_id, String);
//
// if(Roles.userIsInRole(Meteor.userId(), "admin", {anyScope:true})) {
// //TODO: Need to first verify there are no checked out assets to the staff member.
// }
},
});