diff options
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; }); |