Skip to content
Snippets Groups Projects
Commit ea9db993 authored by Hagen Dreßler's avatar Hagen Dreßler
Browse files

Add navigate to component create-comment

parent 9e556bd0
1 merge request!46Resolve "comment creation - participant component logic"
...@@ -6,6 +6,7 @@ import { Comment } from '../comment'; ...@@ -6,6 +6,7 @@ import { Comment } from '../comment';
import { RoomService } from '../room.service'; import { RoomService } from '../room.service';
import { CommentService} from '../comment.service'; import { CommentService} from '../comment.service';
import { NotificationService } from '../notification.service'; import { NotificationService } from '../notification.service';
import { Router } from '@angular/router';
@Component({ @Component({
selector: 'app-create-comment', selector: 'app-create-comment',
...@@ -16,6 +17,7 @@ export class CreateCommentComponent implements OnInit { ...@@ -16,6 +17,7 @@ export class CreateCommentComponent implements OnInit {
@Input() room: Room; @Input() room: Room;
constructor( constructor(
private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private roomService: RoomService, private roomService: RoomService,
private commentService: CommentService, private commentService: CommentService,
...@@ -44,6 +46,7 @@ export class CreateCommentComponent implements OnInit { ...@@ -44,6 +46,7 @@ export class CreateCommentComponent implements OnInit {
body: body, body: body,
creationTimestamp: new Date(Date.now()) creationTimestamp: new Date(Date.now())
} as Comment).subscribe(room => { } as Comment).subscribe(room => {
this.router.navigate([`room/${this.room.id}`]);
this.notification.show(`Comment '${subject}' successfully created.`); this.notification.show(`Comment '${subject}' successfully created.`);
}); });
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment