|
|
@@ -13,7 +13,7 @@ import { |
|
|
|
useForm, |
|
|
|
useFormContext, |
|
|
|
} from "react-hook-form"; |
|
|
|
import { Check, Close, Error } from "@mui/icons-material"; |
|
|
|
import { Check, Close, Error, RestartAlt } from "@mui/icons-material"; |
|
|
|
import { StaffResult } from "@/app/api/staff"; |
|
|
|
import { CreateGroupInputs, auth, fetchAuth, saveGroup } from "@/app/api/group/actions"; |
|
|
|
import { IndivUserGroup, UserGroupResult } from "@/app/api/group"; |
|
|
@@ -86,11 +86,12 @@ const EditUserGroup: React.FC<Props> = ({ users, auths, group }) => { |
|
|
|
addAuthIds: group.authIds, |
|
|
|
addUserIds: group.userIds, |
|
|
|
}) |
|
|
|
}, []); |
|
|
|
}, [group, users]); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
resetGroup() |
|
|
|
}, [group, users]); |
|
|
|
}, []); |
|
|
|
// }, [group, users]); |
|
|
|
|
|
|
|
return ( |
|
|
|
<> |
|
|
@@ -136,10 +137,17 @@ const EditUserGroup: React.FC<Props> = ({ users, auths, group }) => { |
|
|
|
{tabIndex === 1 && <AuthorityAllocation auth={auths!!}/>} |
|
|
|
{tabIndex === 2 && <UserAllocation users={users!!} />} |
|
|
|
<Stack direction="row" justifyContent="flex-end" gap={1}> |
|
|
|
<Button |
|
|
|
variant="text" |
|
|
|
startIcon={<RestartAlt />} |
|
|
|
onClick={resetGroup} |
|
|
|
> |
|
|
|
{t("Reset")} |
|
|
|
</Button> |
|
|
|
<Button |
|
|
|
variant="outlined" |
|
|
|
startIcon={<Close />} |
|
|
|
// onClick={handleCancel} |
|
|
|
onClick={() => router.back()} |
|
|
|
> |
|
|
|
{t("Cancel")} |
|
|
|
</Button> |
|
|
|