import { Roles } from 'meteor/roles'; import { FlowRouter } from 'meteor/ostrio:flow-router-extra'; import { Locations } from '../../imports/api/locations.js'; import { LocationTypes } from '../../imports/api/locationTypes.js'; import _classCheckPrivateStaticFieldDescriptor from '@babel/runtime/helpers/classCheckPrivateStaticFieldDescriptor'; Template.locationInfo.onCreated(function () { this.subscribe("LocationTypes"); this.subscribe("Locations"); }); Template.locationInfo.onRendered(function () { }); Template.locationInfo.helpers({ parentLocations: function () { return Locations.find({ isChild: false }); }, childLocation: function () { let parId = Session.get("parentId"); console.log("Child Loc: " + parId); return Locations.find({ parentId: parId }); }, }); Template.locationInfo.events({ 'click .topLevel'(e) { let parentId = e.currentTarget.id; console.log("Parent ID: " + parentId); Session.set("parentId", parentId); }, });