Skip to content
Snippets Groups Projects
Commit 6d8484c1 authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Adjust destination and add test template

parent 4328cc70
No related merge requests found
...@@ -14,5 +14,12 @@ ...@@ -14,5 +14,12 @@
<button mat-icon-button [disabled]="isCreator" (click)="setRead(comment)" [matTooltip]="comment.read ? 'Mark as unread' : 'Mark as read'"> <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> <mat-icon [ngClass]="{'read-icon' : comment.read === true}">visibility</mat-icon>
</button> </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> </div>
</mat-card> </mat-card>
...@@ -54,7 +54,7 @@ export class WsCommentServiceService { ...@@ -54,7 +54,7 @@ export class WsCommentServiceService {
voteUp(comment: Comment): void { voteUp(comment: Comment): void {
const message = new UpVote(comment.userId, comment.id); const message = new UpVote(comment.userId, comment.id);
this.rxStompService.publish({ this.rxStompService.publish({
destination: `/queue/comment.command.patch`, destination: `/queue/vote.command.upvote`,
body: JSON.stringify(message), body: JSON.stringify(message),
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
...@@ -65,7 +65,7 @@ export class WsCommentServiceService { ...@@ -65,7 +65,7 @@ export class WsCommentServiceService {
voteDown(comment: Comment): void { voteDown(comment: Comment): void {
const message = new DownVote(comment.userId, comment.id); const message = new DownVote(comment.userId, comment.id);
this.rxStompService.publish({ this.rxStompService.publish({
destination: `/queue/comment.command.patch`, destination: `/queue/vote.command.downvote`,
body: JSON.stringify(message), body: JSON.stringify(message),
headers: { headers: {
'content-type': 'application/json' 'content-type': 'application/json'
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment