From 5494a9dd3bf3d6c07fb5dbf6f5e74d90a57fe2c3 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 29 Sep 2017 17:57:53 +0100 Subject: [PATCH] Implement wrapper API for removing a room from a group --- src/base-apis.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/base-apis.js b/src/base-apis.js index 27417cd858c..df8223d13c1 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -562,6 +562,20 @@ MatrixBaseApis.prototype.addRoomToGroup = function(groupId, roomId) { return this._http.authedRequest(undefined, "PUT", path, undefined, {}); }; +/** + * @param {string} groupId + * @param {string} roomId + * @return {module:client.Promise} Resolves: Empty object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.removeRoomFromGroup = function(groupId, roomId) { + const path = utils.encodeUri( + "/groups/$groupId/admin/rooms/$roomId", + {$groupId: groupId, $roomId: roomId}, + ); + return this._http.authedRequest(undefined, "DELETE", path, undefined, {}); +}; + /** * @param {string} groupId * @return {module:client.Promise} Resolves: Empty object