diff --git a/src/app/components/moderator/moderator-routing.module.ts b/src/app/components/moderator/moderator-routing.module.ts index 65cf488e9d5e12ae6cf9eab13182916feee798ab..63836d9534b752f191861fc6c92efe97c1309ba6 100644 --- a/src/app/components/moderator/moderator-routing.module.ts +++ b/src/app/components/moderator/moderator-routing.module.ts @@ -27,11 +27,11 @@ const routes: Routes = [ data: { roles: [UserRole.EXECUTIVE_MODERATOR] } }, { - path: 'room/:shortId/moderator/comment/:commentId', + path: 'room/:shortId/comment/:commentId', component: CommentAnswerComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.EXECUTIVE_MODERATOR] } - }, + } ]; @NgModule({ diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index f50edb08a47928a9ac161ad0c460d0733f093504..debd2626abd09afeb0e46e134ecd93c46dc15f88 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -45,6 +45,7 @@ export class CommentComponent implements OnInit { inAnswerView = false; currentVote: string; slideAnimationState = 'hidden'; + roleString: string; constructor(protected authenticationService: AuthenticationService, private route: ActivatedRoute, @@ -66,12 +67,15 @@ export class CommentComponent implements OnInit { switch (this.userRole) { case UserRole.PARTICIPANT.valueOf(): this.isStudent = true; + this.roleString = 'participant'; break; case UserRole.CREATOR.valueOf(): this.isCreator = true; + this.roleString = 'creator'; break; case UserRole.EXECUTIVE_MODERATOR.valueOf(): this.isModerator = true; + this.roleString = 'moderator'; } this.language = localStorage.getItem('currentLang'); this.translateService.use(this.language); @@ -155,8 +159,11 @@ export class CommentComponent implements OnInit { } answerComment() { - const url = this.location.path().slice(0, -1); - this.router.navigate([`${url}/${this.comment.id}`]); + let url: string; + this.route.params.subscribe(params => { + url = `${this.roleString}/room/${params['shortId']}/comment/${this.comment.id}`; + }); + this.router.navigate([url]); } delete(): void {