diff options
author | Dessalines <tyhou13@gmx.com> | 2019-04-03 13:59:37 -0700 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2019-04-03 13:59:37 -0700 |
commit | e690d6c470c6330b31e39448fe9e566a30860b14 (patch) | |
tree | 37f7bf5629f1a5fd01442df2bd3a35c705b40f54 /ui/src/services | |
parent | c7864643812645ecfb560154bcb1e758555126de (diff) |
Adding post editing.
- Adding post editing. Fixes #23
- Making SQL versions of comment and post fetching. Fixes #21
- Starting to add forum categories. #17
Diffstat (limited to 'ui/src/services')
-rw-r--r-- | ui/src/services/UserService.ts | 6 | ||||
-rw-r--r-- | ui/src/services/WebSocketService.ts | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/ui/src/services/UserService.ts b/ui/src/services/UserService.ts index c090aebc..bf93f42a 100644 --- a/ui/src/services/UserService.ts +++ b/ui/src/services/UserService.ts @@ -5,7 +5,7 @@ import { Subject } from 'rxjs'; export class UserService { private static _instance: UserService; - private user: User; + public user: User; public sub: Subject<User> = new Subject<User>(); private constructor() { @@ -45,10 +45,6 @@ export class UserService { console.log(this.user); } - public get fediUserId(): string { - return `${this.user.iss}/${this.user.username}`; - } - public static get Instance(){ return this._instance || (this._instance = new this()); } diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts index 04376ff8..c1fdb73b 100644 --- a/ui/src/services/WebSocketService.ts +++ b/ui/src/services/WebSocketService.ts @@ -80,6 +80,11 @@ export class WebSocketService { this.subject.next(this.wsSendWrapper(UserOperation.CreatePostLike, form)); } + public editPost(postForm: PostForm) { + this.setAuth(postForm); + this.subject.next(this.wsSendWrapper(UserOperation.EditPost, postForm)); + } + private wsSendWrapper(op: UserOperation, data: any) { let send = { op: UserOperation[op], data: data }; console.log(send); |