fixed a bunch of group/team permission stuff on the devices page

This commit is contained in:
Carter 2025-04-25 14:40:49 -06:00
parent 988ab1c683
commit afdbe3426e
7 changed files with 59 additions and 33 deletions

View file

@ -10,7 +10,6 @@ import {
import { makeStyles } from "@mui/styles";
import { useGroupAPI, useSnackbar } from "hooks";
import { Group } from "models";
import { useNavigate } from "react-router-dom";
const useStyles = makeStyles((theme: Theme) => {
return ({
@ -30,7 +29,7 @@ interface Props {
export default function RemoveGroup(props: Props) {
const classes = useStyles();
const navigate = useNavigate();
// const navigate = useNavigate();
const groupAPI = useGroupAPI();
const { success, error, warning } = useSnackbar();
const { group, isDialogOpen, closeDialogCallback, removeCallback } = props;
@ -43,12 +42,9 @@ export default function RemoveGroup(props: Props) {
const submit = () => {
groupAPI
.removeGroup(group.id())
.then((response: any) => {
.then((_response: any) => {
success(groupName + " was successfully removed");
// navigate("/groups");
console.log(removeCallback)
if (removeCallback) removeCallback()
// removeCallback()
})
.catch((err: any) => {
err ? warning(err) : error("Error occured while removing " + groupName);