You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Implement wrapper APIs for adding rooms to group summary
This commit is contained in:
@@ -448,6 +448,16 @@ MatrixBaseApis.prototype.getGroupUsers = function(groupId) {
|
|||||||
return this._http.authedRequest(undefined, "GET", path);
|
return this._http.authedRequest(undefined, "GET", path);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} groupId
|
||||||
|
* @return {module:client.Promise} Resolves: Group rooms list object
|
||||||
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
|
*/
|
||||||
|
MatrixBaseApis.prototype.getGroupRooms = function(groupId) {
|
||||||
|
const path = utils.encodeUri("/groups/$groupId/rooms", {$groupId: groupId});
|
||||||
|
return this._http.authedRequest(undefined, "GET", path);
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} groupId
|
* @param {string} groupId
|
||||||
* @param {string} userId
|
* @param {string} userId
|
||||||
@@ -493,6 +503,23 @@ MatrixBaseApis.prototype.addUserToGroupSummary = function(groupId, userId, roleI
|
|||||||
return this._http.authedRequest(undefined, "PUT", path, undefined, {});
|
return this._http.authedRequest(undefined, "PUT", path, undefined, {});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} groupId
|
||||||
|
* @param {string} roomId
|
||||||
|
* @param {string} categoryId Optional.
|
||||||
|
* @return {module:client.Promise} Resolves: Empty object
|
||||||
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
|
*/
|
||||||
|
MatrixBaseApis.prototype.addRoomToGroupSummary = function(groupId, roomId, categoryId) {
|
||||||
|
const path = utils.encodeUri(
|
||||||
|
categoryId ?
|
||||||
|
"/groups/$groupId/summary/$categoryId/rooms/$roomId" :
|
||||||
|
"/groups/$groupId/summary/rooms/$roomId",
|
||||||
|
{$groupId: groupId, $categoryId: categoryId, $roomId: roomId},
|
||||||
|
);
|
||||||
|
return this._http.authedRequest(undefined, "PUT", path, undefined, {});
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} groupId
|
* @param {string} groupId
|
||||||
* @return {module:client.Promise} Resolves: Empty object
|
* @return {module:client.Promise} Resolves: Empty object
|
||||||
|
|||||||
Reference in New Issue
Block a user