diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index 2e95afd4774f4d2fd9eec5d25a97e93a0ee7e03d..cf6321c8368cbf05fd95479fac72e9f25f50a622 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 c2ecd60f0e63f1b626686f9616de92da87b1c470..7384404df1e76bf4ee11f6387c0cb2ce8ea52e22 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'