fixed indexing wrong group when getting permissions
This commit is contained in:
parent
1b1d6e4485
commit
b4c1a543de
4 changed files with 53 additions and 21 deletions
|
|
@ -120,10 +120,15 @@ export default function Devices() {
|
|||
setGroups(newGroups);
|
||||
};
|
||||
|
||||
const getGroupKey = () => {
|
||||
return parseInt(tab+1)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
setGroupPermissions([])
|
||||
if (tab === "all") return
|
||||
groupAPI.getGroupPermissions(parseInt(tab)).then(resp => {
|
||||
groupAPI.getGroupPermissions(getGroupKey()).then(resp => {
|
||||
console.log(resp)
|
||||
setGroupPermissions(resp.data.permissions)
|
||||
})
|
||||
}, [tab])
|
||||
|
|
@ -155,7 +160,7 @@ export default function Devices() {
|
|||
if (tab !== "all") {
|
||||
let keys = getContextKeys()
|
||||
//keys.splice(keys.length - 1, 0, getGroup().id().toString());
|
||||
keys.push(getGroup().id().toString());
|
||||
keys.push(getGroupKey().toString());
|
||||
return keys
|
||||
} else {
|
||||
return getContextKeys()
|
||||
|
|
@ -376,7 +381,7 @@ export default function Devices() {
|
|||
}
|
||||
|
||||
const getGroup = () => {
|
||||
let group = groups[parseInt(tab)]
|
||||
let group = groups[parseInt(tab+1)]
|
||||
return group
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -162,7 +162,8 @@ export default function TeamPage() {
|
|||
<Grid2 container direction={"column"} spacing={isMobile ? 0 : 0.5} >
|
||||
<Grid2 >
|
||||
<Typography variant={isMobile ? "h5" : "h4"} className={classes.ellipsis} >
|
||||
{team.name()}
|
||||
{/* {team.name()} */}
|
||||
<SmartBreadcrumb paddingBottom={1} teamName={team.name()} />
|
||||
{/* <SmartBreadcrumb /> */}
|
||||
</Typography>
|
||||
</Grid2>
|
||||
|
|
@ -215,8 +216,6 @@ export default function TeamPage() {
|
|||
<PageContainer padding={isMobile ? 0 : 2}>
|
||||
<Box className={classes.container}>
|
||||
<Box className={classes.leftBox}>
|
||||
<SmartBreadcrumb paddingBottom={1} teamName={team.name()} />
|
||||
<SmartBreadcrumb />
|
||||
{title()}
|
||||
</Box>
|
||||
<Box className={classes.rightBox}>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue