updated the component and device api's to have as be a parameter for the function

This commit is contained in:
csawatzky 2025-04-22 14:33:19 -06:00
parent c617ebf868
commit b62c7dbe5c
39 changed files with 346 additions and 651 deletions

View file

@ -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(