diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1364c4b066fb22ad795087d85b0652a6f4a4ea2f..50cfded9ff08fa2256b5e71e8fc02eab3f8059f0 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -58,7 +58,7 @@ const routes: Routes = [ data: { roles: [UserRole.CREATOR] } }, { - path: 'creator/room/:roomId/:id', + path: 'creator/room/:roomId/:contentId', component: ContentDetailComponent, canActivate: [AuthenticationGuard], data: { roles: [UserRole.CREATOR] } diff --git a/src/app/content-detail/content-detail.component.ts b/src/app/content-detail/content-detail.component.ts index 6787bcc6d6e8794926fd2a8c29de65e214f418d2..8abd123cf301f9e7821cea48c9679364604f2d44 100644 --- a/src/app/content-detail/content-detail.component.ts +++ b/src/app/content-detail/content-detail.component.ts @@ -18,12 +18,12 @@ export class ContentDetailComponent implements OnInit { ngOnInit() { this.route.params.subscribe(params => { - this.getContent(params['id']); + this.getContent(params['contentId']); }); } - getContent(id: string): void { - this.contentService.getContent(id) + getContent(contentId: string): void { + this.contentService.getContent(contentId) .subscribe(content => this.content = content); } } diff --git a/src/app/content-list/content-list.component.ts b/src/app/content-list/content-list.component.ts index 0b1443241334733b717711254b97dd93fe6bcb6f..2db858053d2f69965c8fbfefb89ca66150da4f7f 100644 --- a/src/app/content-list/content-list.component.ts +++ b/src/app/content-list/content-list.component.ts @@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core'; import { ContentService } from '../content.service'; import { Content } from '../content'; import { ActivatedRoute } from '@angular/router'; -import { RoomService } from '../room.service'; @Component({ selector: 'app-content-list', @@ -12,29 +11,20 @@ import { RoomService } from '../room.service'; export class ContentListComponent implements OnInit { contents: Content[]; - constructor( - private contentService: ContentService, - private route: ActivatedRoute, - private roomService: RoomService, - ) { } + constructor(private contentService: ContentService, + private route: ActivatedRoute) { + } ngOnInit() { this.route.params.subscribe(params => { - this.getRoom(params['roomId']); + this.getContents(params['roomId']); }); } - getRoom(id: string): void { - this.roomService.getRoom(id).subscribe( - params => { - this.getContents(params['id']); - }); - } - getContents(roomId: string): void { this.contentService.getContents(roomId) - .subscribe(contents => { - this.contents = contents; - }); + .subscribe(contents => { + this.contents = contents; + }); } }