@@ -46,6 +46,28 @@ export async function deleteGroup({secretKey, id}) {
4646 return response ;
4747}
4848
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+
4971export async function getGroups ( {
5072 secretKey,
5173 pageNumber,
@@ -163,6 +185,31 @@ export async function deleteChannel({secretKey, groupId, id}) {
163185 return response ;
164186}
165187
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+
166213export async function getChannels ( {
167214 secretKey,
168215 groupId,
0 commit comments