fixed permission issue with groups, added groups and devices links to team page
This commit is contained in:
parent
400b7d54a4
commit
9edb6bbb2f
5 changed files with 81 additions and 11 deletions
|
|
@ -63,14 +63,13 @@ export default function UserWrapper(props: Props) {
|
|||
const hasFetched = useRef(false);
|
||||
const [global, setGlobal] = useState<undefined | GlobalState>(undefined)
|
||||
|
||||
let user_id = or(useAuth.user?.sub, "")
|
||||
const user_id = or(useAuth.user?.sub, "")
|
||||
|
||||
const loadUser = useCallback(() => {
|
||||
if (!userAPI.getUserWithTeam) return;
|
||||
if (hasFetched.current) return;
|
||||
setLoading(true)
|
||||
userAPI.getUserWithTeam(user_id).then(resp => {
|
||||
console.log(resp.data.user)
|
||||
setGlobal({
|
||||
user: resp.data.user ? User.create(resp.data.user) : User.create(),
|
||||
team: resp.data.team ? Team.create(resp.data.team) : Team.create(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue