From 26b8cea6a5a22aee5b94ed8727c6e0be69ae79e5 Mon Sep 17 00:00:00 2001 From: Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> Date: Wed, 7 Oct 2020 20:50:10 +0200 Subject: [PATCH] Add button to purge rooms to room list (#44) * Add button to purge rooms to room list Add button (BulkDeleteButton) to delete rooms with no local users: - purge rooms `POST /_synapse/admin/v1/purge_room` (https://github.com/matrix-org/synapse/blob/master/docs/admin_api/purge_room.md) * Bugfix of merge 'master' * Change from purge room to delete room endpoint --- src/components/rooms.js | 2 +- src/synapse/dataProvider.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/rooms.js b/src/components/rooms.js index 0299efb..5cf4369 100644 --- a/src/components/rooms.js +++ b/src/components/rooms.js @@ -1,4 +1,4 @@ -import React from "react"; +import React, { Fragment } from "react"; import { connect } from "react-redux"; import { BooleanField, diff --git a/src/synapse/dataProvider.js b/src/synapse/dataProvider.js index 9d3e015..361cfbc 100644 --- a/src/synapse/dataProvider.js +++ b/src/synapse/dataProvider.js @@ -66,6 +66,11 @@ const resourceMap = { total: json => { return json.total_rooms; }, + delete: id => ({ + endpoint: `/_synapse/admin/v1/rooms/${id}/delete`, + body: { block: false }, + method: "POST", + }), }, devices: { map: d => ({