can now to npm run start-dev to run local front end with the development database

This commit is contained in:
Carter 2025-02-19 13:56:30 -06:00
parent b5fe74664c
commit c636737718
4 changed files with 11 additions and 12 deletions

View file

@ -116,6 +116,7 @@ export default function GroupSettings(props: Props) {
}
if (prevTabIndex !== 1 && tabIndex === 1) {
console.log("loading?")
loadDevices();
}
}, [initialGroup, loadDevices, prevInitialGroup, prevTabIndex, props, tabIndex, groupDevices]);
@ -310,7 +311,8 @@ export default function GroupSettings(props: Props) {
<Checkbox
edge="end"
onChange={() => changeDevices(device.id())}
checked={group.settings.devices.includes(device.id())}
// checked={group.settings.devices.includes(device.id())}
checked={groupDevices?.some(dev => dev.id() === device.id())}
inputProps={{ "aria-labelledby": label }}
disabled={!canEdit}
/>
@ -331,12 +333,16 @@ export default function GroupSettings(props: Props) {
const addDevice = (device: number) => {
console.log("adding device?????")
groupAPI.addDevice(group.id(), device).then(() => {
console.log("successfully added")
refreshCallback();
}).catch(() => {
console.log("Error adding")
});
};
const removeDevice = (device: number) => {
groupAPI.removeDevice(group.id(), device).then(() => {
console.log("successfully removed")
refreshCallback();
});
};