Skip to content

Commit

Permalink
Update EditGroup.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
BNWEIN committed Jun 26, 2024
1 parent b486515 commit 17432bf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/views/identity/administration/EditGroup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ const EditGroup = () => {
const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery()

const [roleInfo, setroleInfo] = React.useState([])
const [allowExternal, setAllowExternal] = useState(false)
useEffect(() => {
if (ownersIsSuccess && membersIsSuccess) {
const ownerWithRole = owners.map((owner) => {
Expand Down Expand Up @@ -107,12 +106,6 @@ const EditGroup = () => {
}
}, [groupId, tenantDomain, dispatch])

useEffect(() => {
if (SenderAuthIsSuccess) {
setAllowExternal(!SenderAuth) // If SenderAuth is true, setAllowExternal to false, and vice versa
}
}, [SenderAuthIsSuccess, SenderAuth])

const onSubmit = (values) => {
const shippedValues = {
tenantID: tenantDomain,
Expand Down Expand Up @@ -170,7 +163,12 @@ const EditGroup = () => {
{isSuccess && (
<Form
onSubmit={onSubmit}
initialValues={{ allowExternal }}
initialValues={{
...(group[0].calculatedGroupType === 'Microsoft 365' ||
group[0].calculatedGroupType === 'Distribution List'
? { allowExternal: !SenderAuth.enabled }
: {}),
}}
render={({ handleSubmit, submitting, values }) => {
return (
<CForm onSubmit={handleSubmit}>
Expand Down

0 comments on commit 17432bf

Please sign in to comment.