From 29d6f201c80f600961565c464c7d81e401aa529b Mon Sep 17 00:00:00 2001 From: Carter Date: Thu, 24 Apr 2025 12:20:35 -0600 Subject: [PATCH] ok this time i really fixed it --- src/pages/Devices.tsx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/pages/Devices.tsx b/src/pages/Devices.tsx index 3425c00..327d72d 100644 --- a/src/pages/Devices.tsx +++ b/src/pages/Devices.tsx @@ -120,14 +120,15 @@ export default function Devices() { setGroups(newGroups); }; - const getGroupKey = () => { - return parseInt(tab+1) + const getGroup = () => { + let group = groups[parseInt(tab)] + return group } useEffect(() => { setGroupPermissions([]) if (tab === "all") return - groupAPI.getGroupPermissions(getGroupKey()).then(resp => { + groupAPI.getGroupPermissions(getGroup().id()).then(resp => { console.log(resp) setGroupPermissions(resp.data.permissions) }) @@ -160,7 +161,7 @@ export default function Devices() { if (tab !== "all") { let keys = getContextKeys() //keys.splice(keys.length - 1, 0, getGroup().id().toString()); - keys.push(getGroupKey().toString()); + keys.push(getGroup().id().toString()); return keys } else { return getContextKeys() @@ -380,11 +381,6 @@ export default function Devices() { ) } - const getGroup = () => { - let group = groups[parseInt(tab+1)] - return group - } - const mobile = (row: Device) => { return (