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
5f81ee79
Commit
5f81ee79
authored
5 years ago
by
Tom Käsler
Browse files
Options
Downloads
Patches
Plain Diff
Use count API endpoint for comments
Based on arsnova-comment-service commit b88aa32c54ba773373b817d36313787ae895e809
parent
07005498
1 merge request
!268
Room page comment counter
Pipeline
#27652
passed with stages
in 7 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/shared/room-page/room-page.component.ts
+3
-3
3 additions, 3 deletions
src/app/components/shared/room-page/room-page.component.ts
src/app/services/http/comment.service.ts
+13
-1
13 additions, 1 deletion
src/app/services/http/comment.service.ts
with
16 additions
and
4 deletions
src/app/components/shared/room-page/room-page.component.ts
+
3
−
3
View file @
5f81ee79
...
...
@@ -35,9 +35,9 @@ export class RoomPageComponent implements OnInit {
this
.
roomService
.
getRoomByShortId
(
id
).
subscribe
(
room
=>
{
this
.
room
=
room
;
this
.
isLoading
=
false
;
this
.
commentService
.
getComments
(
this
.
room
.
id
)
.
subscribe
(
comment
s
=>
{
this
.
commentCounter
=
comment
s
.
length
;
this
.
commentService
.
countByRoomId
(
this
.
room
.
id
)
.
subscribe
(
comment
Counter
=>
{
this
.
commentCounter
=
comment
Counter
;
});
this
.
wsCommentService
.
getCommentStream
(
this
.
room
.
id
).
subscribe
((
message
:
Message
)
=>
{
const
msg
=
JSON
.
parse
(
message
.
body
);
...
...
This diff is collapsed.
Click to expand it.
src/app/services/http/comment.service.ts
+
13
−
1
View file @
5f81ee79
...
...
@@ -14,7 +14,8 @@ export class CommentService extends BaseHttpService {
private
apiUrl
=
{
base
:
'
/api
'
,
comment
:
'
/comment
'
,
find
:
'
/find
'
find
:
'
/find
'
,
count
:
'
/count
'
};
constructor
(
private
http
:
HttpClient
)
{
...
...
@@ -74,4 +75,15 @@ export class CommentService extends BaseHttpService {
catchError
(
this
.
handleError
<
Comment
>
(
'
deleteComment
'
))
);
}
countByRoomId
(
roomId
:
string
):
Observable
<
number
>
{
const
connectionUrl
=
this
.
apiUrl
.
base
+
this
.
apiUrl
.
comment
+
this
.
apiUrl
.
find
+
this
.
apiUrl
.
count
;
return
this
.
http
.
post
<
number
>
(
connectionUrl
,
{
properties
:
{
roomId
:
roomId
},
externalFilters
:
{}
},
httpOptions
).
pipe
(
tap
(
_
=>
''
),
catchError
(
this
.
handleError
<
number
>
(
'
countByRoomId
'
,
0
))
);
}
}
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