]> Untitled Git - lemmy-ui.git/blobdiff - src/shared/components/community/community.tsx
Adding purging of comments, posts, communities, and users. (#459)
[lemmy-ui.git] / src / shared / components / community / community.tsx
index ab00af14a683af0be8720f24fcd6c9ba07925996..29e3a97d76d37d3c5381bf3d3770b03220cf01db 100644 (file)
@@ -19,6 +19,7 @@ import {
   PostReportResponse,
   PostResponse,
   PostView,
+  PurgeItemResponse,
   SortType,
   toOption,
   UserOperation,
@@ -656,6 +657,12 @@ export class Community extends Component<any, State> {
       if (data) {
         toast(i18n.t("report_created"));
       }
+    } else if (op == UserOperation.PurgeCommunity) {
+      let data = wsJsonToRes<PurgeItemResponse>(msg, PurgeItemResponse);
+      if (data.success) {
+        toast(i18n.t("purge_success"));
+        this.context.router.history.push(`/`);
+      }
     }
   }
 }