From 6d8484c18f29b9a41de41155acf59f35d8d35392 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Mau=C3=9F?= <lukas.mauss@mni.thm.de>
Date: Thu, 21 Mar 2019 20:54:48 +0100
Subject: [PATCH] Adjust destination and add test template

---
 src/app/components/shared/comment/comment.component.html  | 7 +++++++
 src/app/services/websockets/ws-comment-service.service.ts | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html
index 2e95afd47..cf6321c83 100644
--- a/src/app/components/shared/comment/comment.component.html
+++ b/src/app/components/shared/comment/comment.component.html
@@ -14,5 +14,12 @@
     <button mat-icon-button [disabled]="isCreator" (click)="setRead(comment)" [matTooltip]="comment.read ? 'Mark  as unread' : 'Mark as read'">
       <mat-icon [ngClass]="{'read-icon' : comment.read === true}">visibility</mat-icon>
     </button>
+    <button mat-icon-button [disabled]="!isCreator" (click)="voteUp(comment)">
+      <mat-icon>keyboard_arrow_up</mat-icon>
+    </button>
+    <h4>{{comment.score}}</h4>
+    <button mat-icon-button [disabled]="!isCreator" (click)="voteDown(comment)">
+      <mat-icon>keyboard_arrow_down</mat-icon>
+    </button>
   </div>
 </mat-card>
diff --git a/src/app/services/websockets/ws-comment-service.service.ts b/src/app/services/websockets/ws-comment-service.service.ts
index c2ecd60f0..7384404df 100644
--- a/src/app/services/websockets/ws-comment-service.service.ts
+++ b/src/app/services/websockets/ws-comment-service.service.ts
@@ -54,7 +54,7 @@ export class WsCommentServiceService {
   voteUp(comment: Comment): void {
     const message = new UpVote(comment.userId, comment.id);
     this.rxStompService.publish({
-      destination: `/queue/comment.command.patch`,
+      destination: `/queue/vote.command.upvote`,
       body: JSON.stringify(message),
       headers: {
         'content-type': 'application/json'
@@ -65,7 +65,7 @@ export class WsCommentServiceService {
   voteDown(comment: Comment): void {
     const message = new DownVote(comment.userId, comment.id);
     this.rxStompService.publish({
-      destination: `/queue/comment.command.patch`,
+      destination: `/queue/vote.command.downvote`,
       body: JSON.stringify(message),
       headers: {
         'content-type': 'application/json'
-- 
GitLab