From 2d68daf383c42d5a3c4c07440b376e106ab6ed83 Mon Sep 17 00:00:00 2001 From: Joachim Nielandt Date: Sun, 4 Mar 2018 16:55:10 +0100 Subject: [PATCH] Removed post types completely. --- src/app/components/post/post.component.ts | 2 +- src/app/components/posts/posts.component.html | 7 +------ src/app/services/dataloader.service.ts | 7 +++++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/app/components/post/post.component.ts b/src/app/components/post/post.component.ts index af6f640..d4441e6 100644 --- a/src/app/components/post/post.component.ts +++ b/src/app/components/post/post.component.ts @@ -19,7 +19,7 @@ export class PostComponent implements OnInit { // console.log('post component has inited: '+this.post.id); // console.log(this.post); - this.dataloaderService.getPost(this.post.type, this.post.id).subscribe(content => { + this.dataloaderService.getPost(this.post.id).subscribe(content => { this.htmlContainer.nativeElement.innerHTML = content; }); } diff --git a/src/app/components/posts/posts.component.html b/src/app/components/posts/posts.component.html index b213059..2bc23b3 100644 --- a/src/app/components/posts/posts.component.html +++ b/src/app/components/posts/posts.component.html @@ -3,11 +3,6 @@ --> -
- - -
-
-
\ No newline at end of file + diff --git a/src/app/services/dataloader.service.ts b/src/app/services/dataloader.service.ts index b929953..840f859 100644 --- a/src/app/services/dataloader.service.ts +++ b/src/app/services/dataloader.service.ts @@ -37,14 +37,17 @@ export class DataloaderService { * Fetch the 'full fat' post. This returns HTML content that can be wrapped in any container, no sanitizing done. * @param filename the filename for which the post needs to be fetched */ - getPost(type: String, id: String): Observable { + getPost(id: String): Observable { const httpOptions = { headers: new HttpHeaders({ 'Content-Type': 'text/html', 'Accept': 'text/html' }) }; // console.log('launching GET'); - const url = 'assets/post/' + type + '/' + id + '/full.html'; + const url = 'assets/post/' + id + '/full.html'; + // console.log('fetching: '+url); + console.log('getPost called: '+url); + return this.http.get(url, {responseType: 'text'}); }