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
df599dd7
Commit
df599dd7
authored
Jul 02, 2018
by
Lukas Burgey
Browse files
Add some types
parent
ed1d192a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/types/types.module.ts
View file @
df599dd7
...
...
@@ -96,7 +96,7 @@ export interface StateAPIResult {
user
:
User
;
user_state
:
UserState
;
services
:
Service
[];
error
:
string
;
error
?
:
string
;
}
...
...
src/app/user.service.ts
View file @
df599dd7
...
...
@@ -78,16 +78,18 @@ export class UserService {
subscription
.
map
((
message
:
Message
)
=>
{
return
message
.
body
;
}).
subscribe
((
body
:
any
)
=>
{
let
json
=
JSON
.
parse
(
body
);
if
(
json
.
message
&&
json
.
message
!=
''
)
{
this
.
snackBar
.
open
(
json
.
message
);
this
.
messages
.
push
(
json
.
message
);
}
if
(
json
.
user_state
)
{
this
.
updateUserState
(
json
.
user_state
);
}).
subscribe
(
(
body
:
any
)
=>
{
let
json
:
t
.
StateAPIResult
=
JSON
.
parse
(
body
);
if
(
json
.
error
&&
json
.
error
!=
''
)
{
this
.
snackBar
.
open
(
json
.
error
);
this
.
messages
.
push
(
json
.
error
);
}
if
(
json
.
user_state
)
{
this
.
updateUserState
(
json
.
user_state
);
}
}
}
);
);
}
private
updateUser
(
newUser
:
t
.
User
)
{
...
...
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