1
0
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:
Luke Barnard
2017-11-30 10:16:18 +00:00
committed by GitHub
parent 0238ecebed
commit 7f590af0b5

View File

@@ -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
// ===============