From bd19fde038516af6937e21c1cdfe710d635cf515 Mon Sep 17 00:00:00 2001
From: Lukas Kimpel <lukas.kimpel@mni.thm.de>
Date: Wed, 14 Mar 2018 19:17:15 +0100
Subject: [PATCH] Bugfix Adjust types and variable names

---
 src/app/comment.service.ts                         | 2 +-
 src/app/comment.ts                                 | 2 +-
 src/app/create-comment/create-comment.component.ts | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/app/comment.service.ts b/src/app/comment.service.ts
index af4feb569..c969de6e0 100644
--- a/src/app/comment.service.ts
+++ b/src/app/comment.service.ts
@@ -40,7 +40,7 @@ export class CommentService extends ErrorHandlingService {
     );
   }
 
-  searchComments(roomId: string, userId: number): Observable<Comment[]> {
+  searchComments(roomId: string, userId: string): Observable<Comment[]> {
     const url = `${this.commentsUrl}/?roomId=${roomId}&userId=${userId}`;
     return this.http.get<Comment[]>(url).pipe(
       tap (_ => ''),
diff --git a/src/app/comment.ts b/src/app/comment.ts
index 4cf12e8cf..ed636d119 100644
--- a/src/app/comment.ts
+++ b/src/app/comment.ts
@@ -1,7 +1,7 @@
 export class Comment {
   id: string;
   roomId: string;
-  userId: number;
+  userId: string;
   revision: string;
   subject: string;
   body: string;
diff --git a/src/app/create-comment/create-comment.component.ts b/src/app/create-comment/create-comment.component.ts
index 3d62dfa17..f999946d7 100644
--- a/src/app/create-comment/create-comment.component.ts
+++ b/src/app/create-comment/create-comment.component.ts
@@ -46,8 +46,9 @@ export class CreateCommentComponent implements OnInit {
       return;
     }
     this.commentService.addComment({
+      id: this.room.id + this.user.userId,
       roomId: this.room.id,
-      userId: this.user.id,
+      userId: this.user.userId,
       subject: subject,
       body: body,
       creationTimestamp: new Date(Date.now())
-- 
GitLab