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
21bcdcf2
There was a problem fetching the latest pipeline status.
Verified
Commit
21bcdcf2
authored
7 years ago
by
Lukas Maximilian Kimpel
Browse files
Options
Downloads
Patches
Plain Diff
Group api urls
parent
31d989bd
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!87
participant home screen api
Pipeline
#13700
passed with stage
in 32 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/app/room.service.ts
+15
-13
15 additions, 13 deletions
src/app/room.service.ts
with
15 additions
and
13 deletions
src/app/room.service.ts
+
15
−
13
View file @
21bcdcf2
...
...
@@ -12,10 +12,12 @@ const httpOptions = {
@
Injectable
()
export
class
RoomService
extends
ErrorHandlingService
{
private
apiBaseUrl
=
'
https://arsnova-staging.mni.thm.de/api
'
;
private
roomsUrl
=
'
/room
'
;
private
userUrl
=
'
/user
'
;
private
findRoomsUrl
=
'
/find
'
;
private
apiUrl
=
{
base
:
'
https://arsnova-staging.mni.thm.de/api
'
,
rooms
:
'
/room
'
,
user
:
'
/user
'
,
findRooms
:
'
/find
'
};
private
joinDate
=
new
Date
(
Date
.
now
());
constructor
(
private
http
:
HttpClient
,
...
...
@@ -24,18 +26,18 @@ export class RoomService extends ErrorHandlingService {
}
getCreatorRooms
():
Observable
<
Room
[]
>
{
const
url
=
this
.
api
BaseUrl
+
this
.
rooms
Url
+
this
.
findRooms
Url
;
const
url
=
this
.
api
Url
.
base
+
this
.
apiUrl
.
rooms
+
this
.
apiUrl
.
findRooms
;
return
this
.
http
.
post
<
Room
[]
>
(
url
,
{
properties
:
{
ownerId
:
this
.
authService
.
getUser
().
id
},
externalFilters
:
{}
}).
pipe
(
tap
(
_
=>
''
),
tap
(
()
=>
''
),
catchError
(
this
.
handleError
(
'
getRooms
'
,
[]))
);
}
getParticipantRooms
():
Observable
<
Room
[]
>
{
const
url
=
this
.
api
BaseUrl
+
this
.
rooms
Url
+
this
.
findRooms
Url
;
const
url
=
this
.
api
Url
.
base
+
this
.
apiUrl
.
rooms
+
this
.
apiUrl
.
findRooms
;
return
this
.
http
.
post
<
Room
[]
>
(
url
,
{
properties
:
{},
externalFilters
:
{
inHistoryOfUserId
:
this
.
authService
.
getUser
().
id
}
...
...
@@ -46,7 +48,7 @@ export class RoomService extends ErrorHandlingService {
}
addRoom
(
room
:
Room
):
Observable
<
Room
>
{
const
connectionUrl
=
this
.
api
BaseUrl
+
this
.
rooms
Url
+
'
/
'
;
const
connectionUrl
=
this
.
api
Url
.
base
+
this
.
apiUrl
.
rooms
+
'
/
'
;
return
this
.
http
.
post
<
Room
>
(
connectionUrl
,
{
ownerId
:
this
.
authService
.
getUser
().
id
,
abbreviation
:
room
.
abbreviation
,
name
:
room
.
name
,
closed
:
room
.
closed
,
description
:
room
.
description
...
...
@@ -54,26 +56,26 @@ export class RoomService extends ErrorHandlingService {
}
getRoom
(
id
:
string
):
Observable
<
Room
>
{
const
connectionUrl
=
`
${
this
.
api
BaseUrl
}${
this
.
rooms
Url
}
/~
${
id
}
`
;
const
connectionUrl
=
`
${
this
.
api
Url
.
base
}${
this
.
apiUrl
.
rooms
}
/~
${
id
}
`
;
return
this
.
http
.
get
<
Room
>
(
connectionUrl
).
pipe
(
catchError
(
this
.
handleError
<
Room
>
(
`getRoom id=
${
id
}
`
))
);
}
addToHistory
(
roomId
:
string
):
void
{
const
connectionUrl
=
`
${
this
.
api
BaseUrl
}${
this
.
user
Url
}
/
${
this
.
authService
.
getUser
().
id
}
/roomHistory`
;
const
connectionUrl
=
`
${
this
.
api
Url
.
base
}${
this
.
apiUrl
.
user
}
/
${
this
.
authService
.
getUser
().
id
}
/roomHistory`
;
this
.
http
.
post
(
connectionUrl
,
{
roomId
:
roomId
,
lastVisit
:
this
.
joinDate
.
getTime
()
},
httpOptions
).
subscribe
(
r
=>
console
.
log
(
r
));
}
getRoomById
(
id
:
string
):
Observable
<
Room
>
{
const
connectionUrl
=
`
${
this
.
api
BaseUrl
}${
this
.
rooms
Url
}
/
${
id
}
`
;
const
connectionUrl
=
`
${
this
.
api
Url
.
base
}${
this
.
apiUrl
.
rooms
}
/
${
id
}
`
;
return
this
.
http
.
get
<
Room
>
(
connectionUrl
).
pipe
(
catchError
(
this
.
handleError
<
Room
>
(
`getRoom id=
${
id
}
`
))
);
}
updateRoom
(
room
:
Room
):
Observable
<
Room
>
{
const
connectionUrl
=
`
${
this
.
api
BaseUrl
}${
this
.
rooms
Url
}
/~
${
room
.
shortId
}
`
;
const
connectionUrl
=
`
${
this
.
api
Url
.
base
}${
this
.
apiUrl
.
rooms
}
/~
${
room
.
shortId
}
`
;
return
this
.
http
.
put
(
connectionUrl
,
{
ownerId
:
this
.
authService
.
getUser
().
id
,
abbreviation
:
room
.
abbreviation
,
name
:
room
.
name
,
description
:
room
.
description
...
...
@@ -84,7 +86,7 @@ export class RoomService extends ErrorHandlingService {
}
deleteRoom
(
room
:
Room
):
Observable
<
Room
>
{
const
connectionUrl
=
`
${
this
.
api
BaseUrl
}${
this
.
rooms
Url
}
/
${
room
.
id
}
`
;
const
connectionUrl
=
`
${
this
.
api
Url
.
base
}${
this
.
apiUrl
.
rooms
}
/
${
room
.
id
}
`
;
return
this
.
http
.
delete
<
Room
>
(
connectionUrl
,
httpOptions
).
pipe
(
tap
(()
=>
''
),
catchError
(
this
.
handleError
<
Room
>
(
'
deleteRoom
'
))
...
...
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