From 3a9fd1ed0df59dc5c7936bedcb5ce3271a526ece Mon Sep 17 00:00:00 2001 From: Yaman Qalieh Date: Sun, 4 Sep 2016 20:20:40 -0400 Subject: [PATCH] filter on router --- hourglass/lib/router.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/hourglass/lib/router.js b/hourglass/lib/router.js index b85af25..5bdbcf9 100644 --- a/hourglass/lib/router.js +++ b/hourglass/lib/router.js @@ -4,11 +4,11 @@ Router.route('/', { this.redirect('/login'); } else { return [ - Meteor.subscribe('classes',this.params._id), - Meteor.subscribe('schools',this.params._id), - Meteor.subscribe('work',this.params._id), - Meteor.subscribe('requests',this.params._id), - Meteor.subscribe('users',this.params._id) + Meteor.subscribe('classes', this.params._id), + Meteor.subscribe('schools', this.params._id), + Meteor.subscribe('work', this.params._id), + Meteor.subscribe('requests', this.params._id), + Meteor.subscribe('users', this.params._id) ]; } }, @@ -33,15 +33,15 @@ Router.route('/profile', { this.redirect('/login'); } else { return [ - Meteor.subscribe('classes',this.params._id), - Meteor.subscribe('schools',this.params._id), - Meteor.subscribe('work',this.params._id), - Meteor.subscribe('requests',this.params._id), - Meteor.subscribe('users',this.params._id) + Meteor.subscribe('classes', this.params._id), + Meteor.subscribe('schools', this.params._id), + Meteor.subscribe('work', this.params._id), + Meteor.subscribe('requests', this.params._id), + Meteor.subscribe('users', this.params._id) ]; } }, - action: function() { + action: function() { this.render("profile"); } }); @@ -50,17 +50,17 @@ Router.route('/admin', { waitOn: function() { if (Roles.userIsInRole(Meteor.userId(), ['admin', 'superadmin'])) { return [ - Meteor.subscribe('classes',this.params._id), - Meteor.subscribe('schools',this.params._id), - Meteor.subscribe('work',this.params._id), - Meteor.subscribe('requests',this.params._id), - Meteor.subscribe('users',this.params._id) + Meteor.subscribe('classes', this.params._id), + Meteor.subscribe('schools', this.params._id), + Meteor.subscribe('work', this.params._id), + Meteor.subscribe('requests', this.params._id), + Meteor.subscribe('users', this.params._id) ]; } else { this.render('NotFound'); } }, - action: function() { + action: function() { this.render("admin"); } });