diff options
author | Dessalines <happydooby@gmail.com> | 2019-04-07 22:19:02 -0700 |
---|---|---|
committer | Dessalines <happydooby@gmail.com> | 2019-04-07 22:19:02 -0700 |
commit | 18fed27fa3807d35ede64a1b64e8c32ad8789261 (patch) | |
tree | 1802bf775a0dd97503670c38ceb13d9aa78d95b6 /ui/src/services/WebSocketService.ts | |
parent | 907064b94e4633f02397cad3d65294284dc9f3d9 (diff) |
Adding user details / overview page.
- Fixes #19
Diffstat (limited to 'ui/src/services/WebSocketService.ts')
-rw-r--r-- | ui/src/services/WebSocketService.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index 79f6750a..b5efd6a7 100644 --- a/ui/src/services/WebSocketService.ts +++ b/ui/src/services/WebSocketService.ts @@ -1,5 +1,5 @@ import { wsUri } from '../env'; -import { LoginForm, RegisterForm, UserOperation, CommunityForm, PostForm, CommentForm, CommentLikeForm, GetPostsForm, CreatePostLikeForm, FollowCommunityForm } from '../interfaces'; +import { LoginForm, RegisterForm, UserOperation, CommunityForm, PostForm, CommentForm, CommentLikeForm, GetPostsForm, CreatePostLikeForm, FollowCommunityForm, GetUserDetailsForm } from '../interfaces'; import { webSocket } from 'rxjs/webSocket'; import { Subject } from 'rxjs'; import { retryWhen, delay, take } from 'rxjs/operators'; @@ -106,6 +106,11 @@ export class WebSocketService { this.subject.next(this.wsSendWrapper(UserOperation.EditPost, postForm)); } + public getUserDetails(form: GetUserDetailsForm) { + this.setAuth(form, false); + this.subject.next(this.wsSendWrapper(UserOperation.GetUserDetails, form)); + } + private wsSendWrapper(op: UserOperation, data: any) { let send = { op: UserOperation[op], data: data }; console.log(send); @@ -122,7 +127,7 @@ export class WebSocketService { } -window.onbeforeunload = (e => { +window.onbeforeunload = (() => { WebSocketService.Instance.subject.unsubscribe(); WebSocketService.Instance.subject = null; }); |