summaryrefslogtreecommitdiffstats
path: root/ui/src/services
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-15 16:12:06 -0700
committerDessalines <tyhou13@gmx.com>2019-04-15 16:12:06 -0700
commite94885eb97b3240ed9cec7f97d0f405b2819e922 (patch)
treeb407f0b6ed9be27682e3767271e34933c947cb2a /ui/src/services
parent8590a612f633fe6ba8f8b18379a8a822a3b3019b (diff)
Commiting before I lose everything. I'll do this properly in a merge
Diffstat (limited to 'ui/src/services')
-rw-r--r--ui/src/services/WebSocketService.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts
index 99d65adf..3596bb46 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, GetUserDetailsForm, ListCommunitiesForm } from '../interfaces';
+import { LoginForm, RegisterForm, UserOperation, CommunityForm, PostForm, CommentForm, CommentLikeForm, GetPostsForm, CreatePostLikeForm, FollowCommunityForm, GetUserDetailsForm, ListCommunitiesForm, GetModlogForm, BanFromCommunityForm, AddModToCommunityForm } from '../interfaces';
import { webSocket } from 'rxjs/webSocket';
import { Subject } from 'rxjs';
import { retryWhen, delay, take } from 'rxjs/operators';
@@ -106,11 +106,25 @@ export class WebSocketService {
this.subject.next(this.wsSendWrapper(UserOperation.EditPost, postForm));
}
+ public banFromCommunity(form: BanFromCommunityForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.BanFromCommunity, form));
+ }
+
+ public addModToCommunity(form: AddModToCommunityForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.AddModToCommunity, form));
+ }
+
public getUserDetails(form: GetUserDetailsForm) {
this.setAuth(form, false);
this.subject.next(this.wsSendWrapper(UserOperation.GetUserDetails, form));
}
+ public getModlog(form: GetModlogForm) {
+ this.subject.next(this.wsSendWrapper(UserOperation.GetModlog, form));
+ }
+
private wsSendWrapper(op: UserOperation, data: any) {
let send = { op: UserOperation[op], data: data };
console.log(send);