summaryrefslogtreecommitdiffstats
path: root/ui/src/services/WebSocketService.ts
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-19 21:06:25 -0700
committerDessalines <tyhou13@gmx.com>2019-04-19 21:06:25 -0700
commit9afadfb9c4c5db1796848ec4af9756fe03d51ee3 (patch)
tree22a2ea818d6bfcdb390e398c4c9bd5e05595587c /ui/src/services/WebSocketService.ts
parent6f801bb819169060abcf1d8e901759f133dc6987 (diff)
Saving replies, the actual fixes will be in the merge to dev.
Diffstat (limited to 'ui/src/services/WebSocketService.ts')
-rw-r--r--ui/src/services/WebSocketService.ts23
1 files changed, 21 insertions, 2 deletions
diff --git a/ui/src/services/WebSocketService.ts b/ui/src/services/WebSocketService.ts
index 80555fd9..b2c2a9e0 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, GetModlogForm, BanFromCommunityForm, AddModToCommunityForm, SiteForm, Site, UserView } from '../interfaces';
+import { LoginForm, RegisterForm, UserOperation, CommunityForm, PostForm, SavePostForm, CommentForm, SaveCommentForm, CommentLikeForm, GetPostsForm, CreatePostLikeForm, FollowCommunityForm, GetUserDetailsForm, ListCommunitiesForm, GetModlogForm, BanFromCommunityForm, AddModToCommunityForm, AddAdminForm, BanUserForm, SiteForm, Site, UserView } from '../interfaces';
import { webSocket } from 'rxjs/webSocket';
import { Subject } from 'rxjs';
import { retryWhen, delay, take } from 'rxjs/operators';
@@ -96,6 +96,11 @@ export class WebSocketService {
this.subject.next(this.wsSendWrapper(UserOperation.CreateCommentLike, form));
}
+ public saveComment(form: SaveCommentForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.SaveComment, form));
+ }
+
public getPosts(form: GetPostsForm) {
this.setAuth(form, false);
this.subject.next(this.wsSendWrapper(UserOperation.GetPosts, form));
@@ -111,6 +116,11 @@ export class WebSocketService {
this.subject.next(this.wsSendWrapper(UserOperation.EditPost, postForm));
}
+ public savePost(form: SavePostForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.SavePost, form));
+ }
+
public banFromCommunity(form: BanFromCommunityForm) {
this.setAuth(form);
this.subject.next(this.wsSendWrapper(UserOperation.BanFromCommunity, form));
@@ -121,8 +131,17 @@ export class WebSocketService {
this.subject.next(this.wsSendWrapper(UserOperation.AddModToCommunity, form));
}
+ public banUser(form: BanUserForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.BanUser, form));
+ }
+
+ public addAdmin(form: AddAdminForm) {
+ this.setAuth(form);
+ this.subject.next(this.wsSendWrapper(UserOperation.AddAdmin, form));
+ }
+
public getUserDetails(form: GetUserDetailsForm) {
- this.setAuth(form, false);
this.subject.next(this.wsSendWrapper(UserOperation.GetUserDetails, form));
}