File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -157,6 +157,32 @@ export async function updateDevice({
157157 return response ;
158158}
159159
160+ export async function updateDeviceUser ( {
161+ secretKey,
162+ idOrKey,
163+ userId,
164+ } ) {
165+ const response = await server . loadJson (
166+ `${ Config . apiUrl } ${ Endpoints . PROJECT . NOTIFICATIONS . PUSH . UPDATE_DEVICE_USER (
167+ idOrKey
168+ ) } `,
169+ {
170+ method : 'PATCH' ,
171+ headers : {
172+ 'X-CM-ProjectId' : Config . projectId ,
173+ Authorization : `Bearer ${ secretKey || Config . secretKey } ` ,
174+ Accept : 'application/json' ,
175+ 'Content-Type' : 'application/json' ,
176+ } ,
177+ body : JSON . stringify ( {
178+ userId
179+ } ) ,
180+ }
181+ ) ;
182+
183+ return response ;
184+ }
185+
160186export async function deleteDevice ( { secretKey, idOrKey} ) {
161187 const response = await server . loadJson (
162188 `${ Config . apiUrl } ${ Endpoints . PROJECT . NOTIFICATIONS . PUSH . DELETE_DEVICE (
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export const CONFIG = {
5757 GET_DEVICE : ( id ) => `/v2/notifications/push/devices/${ id } ` ,
5858 GET_DEVICES : '/v2/notifications/push/devices' ,
5959 UPDATE_DEVICE : ( id ) => `/v2/notifications/push/devices/${ id } ` ,
60+ UPDATE_DEVICE_USER : ( id ) => `/v2/notifications/push/devices/${ id } /user` ,
6061 DELETE_DEVICE : ( id ) => `/v2/notifications/push/devices/${ id } ` ,
6162 GET_ALL : '/v2/notifications/push' ,
6263 GET : ( id ) => `/v2/notifications/push/${ id } ` ,
You can’t perform that action at this time.
0 commit comments