diff options
author | Dessalines <tyhou13@gmx.com> | 2020-01-27 21:04:30 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-01-27 21:04:30 -0500 |
commit | 2e84441e6635b42065ef646238a6c95aea207548 (patch) | |
tree | 53b7db65bb5567e13d9c24a6364cde49224af6a4 /ui/src/components/community.tsx | |
parent | 8cfd5f9266a0a93dc47ec2ab6060ee0435276aba (diff) |
Strictly typing websocket forms.
Diffstat (limited to 'ui/src/components/community.tsx')
-rw-r--r-- | ui/src/components/community.tsx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ui/src/components/community.tsx b/ui/src/components/community.tsx index 221c9211..3c5f6890 100644 --- a/ui/src/components/community.tsx +++ b/ui/src/components/community.tsx @@ -11,6 +11,7 @@ import { SortType, Post, GetPostsForm, + GetCommunityForm, ListingType, GetPostsResponse, CreatePostLikeResponse, @@ -98,11 +99,11 @@ export class Community extends Component<any, State> { () => console.log('complete') ); - if (this.state.communityId) { - WebSocketService.Instance.getCommunity(this.state.communityId); - } else if (this.state.communityName) { - WebSocketService.Instance.getCommunityByName(this.state.communityName); - } + let form: GetCommunityForm = { + id: this.state.communityId ? this.state.communityId : null, + name: this.state.communityName ? this.state.communityName : null, + }; + WebSocketService.Instance.getCommunity(form); } componentWillUnmount() { |