mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-11-02 19:27:45 +00:00
16 lines
412 B
JavaScript
16 lines
412 B
JavaScript
import axiosInstance from 'utils/axiosInstance';
|
|
|
|
export default async (deviceId, token, endpoint) => {
|
|
const options = {
|
|
headers: {
|
|
Accept: 'application/json',
|
|
Authorization: `Bearer ${token}`,
|
|
},
|
|
};
|
|
|
|
return axiosInstance
|
|
.get(`${endpoint}/api/v1/device/${encodeURIComponent(deviceId)}/status`, options)
|
|
.then((response) => response.data.connected)
|
|
.catch(() => false);
|
|
};
|