Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
453cfffe
Commit
453cfffe
authored
6 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Implement voting-functions in websocket service
parent
aaad5caa
4 merge requests
!171
SWTP Comment Project
,
!170
Fix linter in pipe
,
!169
WebSocket Connector
,
!168
Filter comment list
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/services/websockets/ws-comment-service.service.ts
+19
-1
19 additions, 1 deletion
src/app/services/websockets/ws-comment-service.service.ts
with
19 additions
and
1 deletion
src/app/services/websockets/ws-comment-service.service.ts
+
19
−
1
View file @
453cfffe
...
...
@@ -4,8 +4,8 @@ import { RxStompService } from '@stomp/ng2-stompjs';
import
{
CreateComment
}
from
'
../../models/messages/create-comment
'
;
import
{
PatchComment
}
from
'
../../models/messages/patch-comment
'
;
import
{
TSMap
}
from
'
typescript-map
'
;
import
{
Vote
}
from
'
../../models/vote
'
;
import
{
UpVote
}
from
'
../../models/messages/up-vote
'
;
import
{
DownVote
}
from
'
../../models/messages/down-vote
'
;
@
Injectable
({
...
...
@@ -53,6 +53,24 @@ export class WsCommentServiceService {
voteUp
(
comment
:
Comment
):
void
{
const
message
=
new
UpVote
(
comment
.
userId
,
comment
.
id
);
this
.
rxStompService
.
publish
({
destination
:
`/queue/comment.command.patch`
,
body
:
JSON
.
stringify
(
message
),
headers
:
{
'
content-type
'
:
'
application/json
'
}
});
}
voteDown
(
comment
:
Comment
):
void
{
const
message
=
new
DownVote
(
comment
.
userId
,
comment
.
id
);
this
.
rxStompService
.
publish
({
destination
:
`/queue/comment.command.patch`
,
body
:
JSON
.
stringify
(
message
),
headers
:
{
'
content-type
'
:
'
application/json
'
}
});
}
private
patchComment
(
comment
:
Comment
,
changes
:
TSMap
<
string
,
any
>
):
void
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment