]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/community/community.tsx
Reporting (#434)
[lemmy-ui.git] / src / shared / components / community / community.tsx
index e3420855b65d3d5541d66566676c9d1c71f09927..1d77d44f689047a5ad4d26b832b58e41389e9462 100644 (file)
@@ -3,6 +3,7 @@ import {
   AddModToCommunityResponse,
   BanFromCommunityResponse,
   BlockPersonResponse,
+  CommentReportResponse,
   CommentResponse,
   CommentView,
   CommunityResponse,
@@ -14,6 +15,7 @@ import {
   GetPostsResponse,
   GetSiteResponse,
   ListingType,
+  PostReportResponse,
   PostResponse,
   PostView,
   SortType,
@@ -549,6 +551,16 @@ export class Community extends Component<any, State> {
     } else if (op == UserOperation.BlockPerson) {
       let data = wsJsonToRes<BlockPersonResponse>(msg).data;
       updatePersonBlock(data);
+    } else if (op == UserOperation.CreatePostReport) {
+      let data = wsJsonToRes<PostReportResponse>(msg).data;
+      if (data) {
+        toast(i18n.t("report_created"));
+      }
+    } else if (op == UserOperation.CreateCommentReport) {
+      let data = wsJsonToRes<CommentReportResponse>(msg).data;
+      if (data) {
+        toast(i18n.t("report_created"));
+      }
     }
   }
 }