Merged the AssetAssignment collection with the Asset collection; Updated views for assigning assets; Added view to find asset assignments by assetId.

This commit is contained in:
2022-08-14 17:07:14 -07:00
parent f3b1b38e82
commit cf51200393
13 changed files with 3897 additions and 53 deletions

View File

@@ -57,9 +57,16 @@
const createAssignment = () => {
if(assetId && assetId.length && selectedAssignee) {
Meteor.call("AssetAssignments.add", assetId, selectedCategory === 'Student' ? "Student" : "Staff", selectedAssignee._id)
// TODO: Set focus to the asset ID field.
assetId = "";
Meteor.call("assets.assign", assetId, selectedCategory === 'Student' ? "Student" : "Staff", selectedAssignee._id, (err, result) => {
if(err) {
console.error(err);
//TODO: Display an error!
}
else {
// TODO: Set focus to the asset ID field.
assetId = "";
}
});
}
}
</script>