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
4 merge requests!171SWTP Comment Project,!170Fix linter in pipe,!169WebSocket Connector,!168Filter comment list
......@@ -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>
......@@ -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'
......
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