@@ -46,6 +46,28 @@ export async function deleteGroup({secretKey, id}) {
46
46
return response ;
47
47
}
48
48
49
+ export async function addUsersToGroup ( { secretKey, id, users} ) {
50
+ const response = await server . loadJson (
51
+ `${
52
+ Config . eventsApiUrl
53
+ } ${ Endpoints . PROJECT . NOTIFICATIONS . SERVER_EVENTS . ADD_USERS_TO_GROUP ( id ) } `,
54
+ {
55
+ method : 'POST' ,
56
+ headers : {
57
+ 'X-CM-ProjectId' : Config . projectId ,
58
+ Authorization : `Bearer ${ secretKey || Config . secretKey } ` ,
59
+ Accept : 'application/json' ,
60
+ 'Content-Type' : 'application/json' ,
61
+ } ,
62
+ body : JSON . stringify ( {
63
+ users,
64
+ } ) ,
65
+ }
66
+ ) ;
67
+
68
+ return response ;
69
+ }
70
+
49
71
export async function getGroups ( {
50
72
secretKey,
51
73
pageNumber,
@@ -163,6 +185,31 @@ export async function deleteChannel({secretKey, groupId, id}) {
163
185
return response ;
164
186
}
165
187
188
+ export async function addUsersToChannel ( { secretKey, groupId, id, users} ) {
189
+ const response = await server . loadJson (
190
+ `${
191
+ Config . eventsApiUrl
192
+ } ${ Endpoints . PROJECT . NOTIFICATIONS . SERVER_EVENTS . ADD_USERS_TO_CHANNEL (
193
+ groupId ,
194
+ id
195
+ ) } `,
196
+ {
197
+ method : 'POST' ,
198
+ headers : {
199
+ 'X-CM-ProjectId' : Config . projectId ,
200
+ Authorization : `Bearer ${ secretKey || Config . secretKey } ` ,
201
+ Accept : 'application/json' ,
202
+ 'Content-Type' : 'application/json' ,
203
+ } ,
204
+ body : JSON . stringify ( {
205
+ users,
206
+ } ) ,
207
+ }
208
+ ) ;
209
+
210
+ return response ;
211
+ }
212
+
166
213
export async function getChannels ( {
167
214
secretKey,
168
215
groupId,
0 commit comments