Skip to content

Commit

Permalink
Implement wrapper API for removing a room from a group
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Barnard committed Sep 29, 2017
1 parent 96d828d commit 5494a9d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/base-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5494a9d

Please sign in to comment.