From 306e67cba550fd629fe605384cc2df8b7849ff9e Mon Sep 17 00:00:00 2001 From: Areeb Jamal Date: Thu, 21 Jan 2021 15:58:58 +0530 Subject: [PATCH] fix: Move role-invites out from event nesting --- app/router.js | 2 +- app/routes/{public => }/role-invites.js | 6 ++---- app/templates/{public => }/role-invites.hbs | 0 3 files changed, 3 insertions(+), 5 deletions(-) rename app/routes/{public => }/role-invites.js (83%) rename app/templates/{public => }/role-invites.hbs (100%) diff --git a/app/router.js b/app/router.js index 08c33825b95..a8c8c745c80 100644 --- a/app/router.js +++ b/app/router.js @@ -64,8 +64,8 @@ Router.map(function() { this.route('schedule', { path: '/calendar' }); this.route('coc'); this.route('speakers'); - this.route('role-invites'); }); + this.route('role-invites'); this.route('pricing'); this.route('create'); this.route('not-found'); diff --git a/app/routes/public/role-invites.js b/app/routes/role-invites.js similarity index 83% rename from app/routes/public/role-invites.js rename to app/routes/role-invites.js index 9f59e56c089..e7409b10374 100644 --- a/app/routes/public/role-invites.js +++ b/app/routes/role-invites.js @@ -14,7 +14,6 @@ export default class RoleInvitesRoute extends Route { // Since this is only an intermediate page if (this.fastboot.isFastBoot) {return} const { token } = transition.to.queryParams; - const event = transition.resolvedModels.public; const payload = { data: { token } }; @@ -24,8 +23,8 @@ export default class RoleInvitesRoute extends Route { if (this.session.isAuthenticated) { if (this.authManager.currentUser.email === user.email) { - await this.loader.post('/role_invites/accept-invite', payload); - return this.transitionTo('events.view', event); + const invite = await this.loader.post('/role_invites/accept-invite', payload); + return this.transitionTo('events.view', invite.event_identifier); } this.set('session.skipRedirectOnInvalidation', true); @@ -33,7 +32,6 @@ export default class RoleInvitesRoute extends Route { } this.set('redirectionParams', { queryParams: { - event : event.id, inviteToken : token, inviteEmail : user.email } diff --git a/app/templates/public/role-invites.hbs b/app/templates/role-invites.hbs similarity index 100% rename from app/templates/public/role-invites.hbs rename to app/templates/role-invites.hbs