@proxima-nexus/sdk-typescript 2.4.1 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -58,10 +58,16 @@ class EnhancedGroupApi {
|
|
|
58
58
|
return (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.requested], [group_api_1.GroupControllerGetConnectionsTypeEnum.member], requesterUserId));
|
|
59
59
|
}
|
|
60
60
|
async promoteToAdmin(groupId, userId, requesterUserId) {
|
|
61
|
+
// Remove any existing connection
|
|
62
|
+
await (0, errors_1.unwrap)(this.api.removeConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
63
|
+
// Create a new admin connection
|
|
61
64
|
return (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.admin }));
|
|
62
65
|
}
|
|
63
66
|
async demoteToMember(groupId, userId, requesterUserId) {
|
|
64
|
-
|
|
67
|
+
// Remove any existing connection
|
|
68
|
+
await (0, errors_1.unwrap)(this.api.removeConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.admin }));
|
|
69
|
+
// Create a new member connection
|
|
70
|
+
return await (0, errors_1.unwrap)(this.api.addConnection(groupId, userId, requesterUserId, { type: mutate_group_entity_connection_dto_1.MutateGroupEntityConnectionDtoTypeEnum.member }));
|
|
65
71
|
}
|
|
66
72
|
async getAdmins(groupId, requesterUserId) {
|
|
67
73
|
return (0, errors_1.unwrap)(this.api.getConnections(groupId, [group_api_1.GroupControllerGetConnectionsStateEnum.active], [group_api_1.GroupControllerGetConnectionsTypeEnum.admin], requesterUserId));
|