updated the component and device api's to have as be a parameter for the function
This commit is contained in:
parent
c617ebf868
commit
b62c7dbe5c
39 changed files with 346 additions and 651 deletions
|
|
@ -54,7 +54,7 @@ export default function DevicePage() {
|
|||
// console.log("load device page data")
|
||||
if (loading) return
|
||||
setLoading(true)
|
||||
deviceAPI.getPageData(deviceID, getContextKeys(), getContextTypes()).then(resp => {
|
||||
deviceAPI.getPageData(deviceID, getContextKeys(), getContextTypes(), as).then(resp => {
|
||||
let device = Device.any(resp.data.device)
|
||||
// console.log(resp.data.device)
|
||||
setDevice(device)
|
||||
|
|
@ -143,13 +143,13 @@ export default function DevicePage() {
|
|||
|
||||
useEffect(() => {
|
||||
loadDevice()
|
||||
}, [deviceID])
|
||||
}, [deviceID, as])
|
||||
|
||||
const toggleNotificationPreference = () => {
|
||||
let updatedPreferences = cloneDeep(preferences);
|
||||
updatedPreferences.notify = !preferences.notify;
|
||||
deviceAPI
|
||||
.updatePreferences(deviceID, updatedPreferences, getContextKeys(), getContextTypes())
|
||||
.updatePreferences(deviceID, updatedPreferences, getContextKeys(), getContextTypes(), as)
|
||||
.then(() => setPreferences(updatedPreferences))
|
||||
.catch(() => {
|
||||
snackbar.error(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue