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
Add API wrapper for multiple device deletion API (#583)
This commit is contained in:
@@ -1230,6 +1230,27 @@ MatrixBaseApis.prototype.deleteDevice = function(device_id, auth) {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete multiple device
|
||||||
|
*
|
||||||
|
* @param {string[]} devices IDs of the devices to delete
|
||||||
|
* @param {object} auth Optional. Auth data to supply for User-Interactive auth.
|
||||||
|
* @return {module:client.Promise} Resolves: result object
|
||||||
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
|
*/
|
||||||
|
MatrixBaseApis.prototype.deleteMultipleDevices = function(devices, auth) {
|
||||||
|
const body = {devices};
|
||||||
|
|
||||||
|
if (auth) {
|
||||||
|
body.auth = auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this._http.authedRequestWithPrefix(
|
||||||
|
undefined, "POST", "/delete_devices", undefined, body,
|
||||||
|
httpApi.PREFIX_UNSTABLE,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// Push operations
|
// Push operations
|
||||||
// ===============
|
// ===============
|
||||||
|
|||||||
Reference in New Issue
Block a user