Skip to content

Commit

Permalink
Merge pull request #553 from matrix-org/luke/groups-remove-room
Browse files Browse the repository at this point in the history
Implement wrapper API for removing a room from a group
  • Loading branch information
dbkr authored Oct 4, 2017
2 parents 89f7857 + 5494a9d commit f5f8867
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 f5f8867

Please sign in to comment.