From 15017e2388e8b8410efad31408eba8fe50da962d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Thu, 5 Apr 2018 15:11:12 +0200
Subject: [PATCH] Add getComment function

---
 src/app/services/http/comment.service.ts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/app/services/http/comment.service.ts b/src/app/services/http/comment.service.ts
index 32f1f43ac..7a4ce7ba2 100644
--- a/src/app/services/http/comment.service.ts
+++ b/src/app/services/http/comment.service.ts
@@ -21,7 +21,12 @@ export class CommentService extends BaseHttpService {
     super();
   }
 
-  /** TODO: getComment().. **/
+  getComment(comment: Comment): Observable<Comment> {
+    return this.http.get<Comment>(`${ this.apiUrl.base }${ this.apiUrl.comment }/~${comment.id}`, httpOptions).pipe(
+      tap (_ => ''),
+      catchError(this.handleError<Comment>('addComment'))
+    );
+  }
 
   addComment(comment: Comment): Observable<Comment> {
     return this.http.post<Comment>(this.apiUrl.base + this.apiUrl.comment + '/',
-- 
GitLab