1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Implement API wrapper for adding a room to a group (#551)

This commit is contained in:
Luke Barnard
2017-09-27 14:27:19 +01:00
committed by GitHub
parent a8a50384b8
commit 96d828d22b

View File

@@ -548,6 +548,20 @@ MatrixBaseApis.prototype.removeRoomFromGroupSummary = function(groupId, roomId)
return this._http.authedRequest(undefined, "DELETE", 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.addRoomToGroup = function(groupId, roomId) {
const path = utils.encodeUri(
"/groups/$groupId/admin/rooms/$roomId",
{$groupId: groupId, $roomId: roomId},
);
return this._http.authedRequest(undefined, "PUT", path, undefined, {});
};
/**
* @param {string} groupId
* @return {module:client.Promise} Resolves: Empty object