diff --git a/.meteor/packages b/.meteor/packages index 506a3b6..28a8af1 100644 --- a/.meteor/packages +++ b/.meteor/packages @@ -37,4 +37,4 @@ msavin:mongol # Free version of MeteorToys - Provides access t #zodern:melte # Alternative to meteor-svelte (https://github.com/meteor-svelte/meteor-svelte). Was more actively developed. svelte:compiler # Switching back to this because of TS errors. -tunguska:reactive-aggregate # Allows us to create a new client collection (from the server) with the contents being an aggregate of server data. Note that aggregation can only be done on the server currently as mini-mongo does not support it. \ No newline at end of file +#tunguska:reactive-aggregate # Allows us to create a new client collection (from the server) with the contents being an aggregate of server data. Note that aggregation can only be done on the server currently as mini-mongo does not support it. \ No newline at end of file diff --git a/imports/api/asset-assignments.js b/imports/api/asset-assignments.js index cad8a39..73739bf 100644 --- a/imports/api/asset-assignments.js +++ b/imports/api/asset-assignments.js @@ -49,13 +49,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({ @@ -66,25 +67,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. + // } }, }); diff --git a/imports/api/assets.js b/imports/api/assets.js index 59d9105..86f6f82 100644 --- a/imports/api/assets.js +++ b/imports/api/assets.js @@ -4,7 +4,6 @@ import { check } from 'meteor/check'; import { Roles } from 'meteor/alanning:roles'; //import SimpleSchema from "simpl-schema"; import {AssetTypes} from "./asset-types"; -import { ReactiveAggregate } from 'meteor/tunguska:reactive-aggregate'; import {AssetAssignments} from "/imports/api/asset-assignments"; // console.log("Setting Up Assets...") diff --git a/imports/api/staff.js b/imports/api/staff.js index 34b35e7..759c58b 100644 --- a/imports/api/staff.js +++ b/imports/api/staff.js @@ -4,7 +4,6 @@ import { Roles } from 'meteor/alanning:roles'; import {check} from "meteor/check"; import {Sites} from "/imports/api/sites"; import {parse} from "csv-parse"; -import { ReactiveAggregate } from 'meteor/tunguska:reactive-aggregate'; // console.log("Setting Up Staff...") @@ -15,15 +14,6 @@ if (Meteor.isServer) { Meteor.publish('staff', function(siteId) { return Staff.find({siteId}); }); - Meteor.publish('staffWithAssetAssignments', function(query) { - ReactiveAggregate(this, Staff, {$lookup: { - from: 'assetAssignments', - localField: '_id', - foreignField: 'assigneeId', - as: 'assignments' - }}, {}); - //Note: The options can use {clientCollection: 'your_name_here'} as the options to change the collection name on the client. - }); } Meteor.methods({ 'staff.add'(firstName, lastName, email, siteId) { diff --git a/imports/api/students.js b/imports/api/students.js index cb4a4ce..5b659b9 100644 --- a/imports/api/students.js +++ b/imports/api/students.js @@ -4,7 +4,6 @@ import { check } from 'meteor/check'; import {Sites} from "./sites"; import { Roles } from 'meteor/alanning:roles'; import {parse} from 'csv-parse'; -import { ReactiveAggregate } from 'meteor/tunguska:reactive-aggregate'; // console.log("Setting Up Students...") @@ -17,15 +16,6 @@ if (Meteor.isServer) { Meteor.publish('students', function(siteId) { return Students.find({siteId}); }); - Meteor.publish('studentWithAssetAssignments', function(query) { - ReactiveAggregate(this, Students, {$lookup: { - from: 'assetAssignments', - localField: '_id', - foreignField: 'assigneeId', - as: 'assignments' - }}, {}); - //Note: The options can use {clientCollection: 'your_name_here'} as the options to change the collection name on the client. - }); Meteor.methods({ 'students.getPossibleGrades'() {