Updated meteor; Modified the assignments byPerson page considerably to improve the workflow; Added an external id to sites; Added an import for students; Improved the students page.

This commit is contained in:
2023-06-16 11:52:48 -07:00
parent 9444cac85d
commit 3c76d5e6a0
15 changed files with 664 additions and 180 deletions

View File

@@ -10,6 +10,7 @@ import {AssetAssignmentHistory} from "/imports/api/asset-assignment-history";
export const Assets = new Mongo.Collection('assets');
export const conditions = ['New','Like New','Good','Okay','Damaged', 'Missing', 'Decommissioned']
export const functionalConditions = ['New','Like New','Good','Okay']
/*
const AssetsSchema = new SimpleSchema({
@@ -135,6 +136,24 @@ Meteor.methods({
}
else throw new Meteor.Error("User Permission Error");
},
'assets.updateCondition'(_id, condition, conditionDetails) {
console.log("updating condtition: " + condition + " / " + conditionDetails)
check(_id, String)
check(condition, String)
if(conditionDetails) check(conditionDetails, String)
if(!conditions.includes(condition)) {
//Should never happen.
console.error("Invalid condition option in assets.update(..)");
throw new Meteor.Error("Invalid condition option.");
}
if(Roles.userIsInRole(Meteor.userId(), "laptop-management", {anyScope:true})) {
console.log("updating .... ")
Assets.update({_id}, {$set: {condition, conditionDetails}});
}
else throw new Meteor.Error("User Permission Error");
},
'assets.remove'(_id) {
check(_id, String);