Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
feudal
feudalWebpage
Commits
be6cf140
Commit
be6cf140
authored
Feb 27, 2020
by
Lukas Burgey
Browse files
Merge branch 'urls' into dev
parents
a2b25760
b2e34dc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/app/user.service.ts
View file @
be6cf140
...
...
@@ -221,7 +221,7 @@ export class UserService {
}
private
fetch
():
void
{
this
.
http
.
get
<
State
>
(
'
/
backend/api
/state
'
).
subscribe
(
this
.
http
.
get
<
State
>
(
'
/
webpage
/state
'
).
subscribe
(
(
state
:
State
)
=>
this
.
updateState
(
state
),
this
.
handleError
(
false
,
'
Error fetching state. Try again later
'
),
);
...
...
@@ -270,7 +270,7 @@ export class UserService {
}
private
fetchIdPInfo
():
void
{
this
.
http
.
get
<
IdPInfo
>
(
'
/
backend/
auth/
v1/
info
'
).
subscribe
(
this
.
http
.
get
<
IdPInfo
>
(
'
/auth/info
'
).
subscribe
(
idpInfo
=>
{
this
.
idpInfo
.
next
(
idpInfo
);
this
.
idpInfo
.
complete
();
...
...
@@ -328,7 +328,7 @@ export class UserService {
}
public
logout
():
void
{
this
.
http
.
post
<
State
>
(
'
/
backend/
auth/
v1/
logout
'
,
undefined
).
subscribe
(
this
.
http
.
post
<
State
>
(
'
/auth/logout
'
,
undefined
).
subscribe
(
(
state
:
State
)
=>
this
.
updateState
(
state
),
(
err
:
HttpErrorResponse
)
=>
{
this
.
updateState
(
undefined
);
...
...
@@ -337,7 +337,7 @@ export class UserService {
}
public
deleteUser
()
{
return
this
.
http
.
delete
(
'
/
rest
/user
'
).
pipe
(
return
this
.
http
.
delete
(
'
/
user
/user
'
).
pipe
(
catchError
(
this
.
handleError
(
true
,
'
Error deleting user
'
)),
).
subscribe
(
_
=>
{
...
...
@@ -350,7 +350,7 @@ export class UserService {
public
uploadSshKey
(
name
:
string
,
key
:
string
|
ArrayBuffer
):
void
{
this
.
http
.
post
<
SSHKey
>
(
'
/
rest
/ssh-keys
'
,
'
/
user
/ssh-keys
'
,
{
'
name
'
:
name
,
'
key
'
:
key
},
).
pipe
(
catchError
(
this
.
handleError
(
true
,
'
Error changing deployment
'
)),
...
...
@@ -366,7 +366,7 @@ export class UserService {
public
removeSshKey
(
key
:
SSHKey
)
{
console
.
log
(
'
Deleting key:
'
,
key
);
return
this
.
http
.
delete
(
`/
rest
/ssh-key/
${
key
.
id
.
toString
()
}
`
,
`/
user
/ssh-key/
${
key
.
id
.
toString
()
}
`
,
).
pipe
(
catchError
(
this
.
handleError
(
true
,
'
Error changing deployment
'
)),
).
subscribe
(
...
...
@@ -380,7 +380,7 @@ export class UserService {
public
patchDeployment
(
depType
:
string
,
stateTarget
:
string
,
id
:
number
):
void
{
this
.
http
.
patch
<
Deployment
>
(
`/
rest
/deployment/
${
depType
}
/
${
id
.
toString
()
}
`
,
`/
user
/deployment/
${
depType
}
/
${
id
.
toString
()
}
`
,
{
'
state_target
'
:
stateTarget
},
).
pipe
(
catchError
(
this
.
handleError
(
true
,
'
Error changing deployment
'
)),
...
...
@@ -391,7 +391,7 @@ export class UserService {
public
sentQuestionnaire
(
stateItemID
:
number
,
answers
:
JSONObject
)
{
return
this
.
http
.
patch
<
DeploymentState
>
(
`/
rest
/state/
${
stateItemID
}
`
,
`/
user
/state/
${
stateItemID
}
`
,
{
'
answers
'
:
answers
},
).
pipe
(
catchError
(
this
.
handleError
(
true
,
'
Error submitting answers
'
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment