1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

expose getDevice API

This commit is contained in:
Matthew Hodgson
2021-03-08 04:59:29 +00:00
parent 844a2b457c
commit 1c4d0b5e99

View File

@@ -1518,6 +1518,21 @@ MatrixBaseApis.prototype.getDevices = function() {
); );
}; };
/**
* Gets specific device details for the logged-in user
* @param {string} device_id device to query
* @return {Promise} Resolves: result object
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixBaseApis.prototype.getDevice = function(device_id) {
const path = utils.encodeUri("/devices/$device_id", {
$device_id: device_id,
});
return this._http.authedRequest(
undefined, 'GET', path, undefined, undefined,
);
};
/** /**
* Update the given device * Update the given device
* *