Skip to content

Commit 7fd3128

Browse files
fixes external sender
1 parent 9eca131 commit 7fd3128

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

src/store/api/groups.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ export const groupsApi = baseApi.injectEndpoints({
6060
}),
6161
}),
6262
listGroupSenderAuth: builder.query({
63-
query: ({ tenantDomain, groupId }) => ({
63+
query: ({ tenantDomain, groupId, type }) => ({
6464
path: '/api/ListGroupSenderAuthentication',
6565
params: {
6666
TenantFilter: tenantDomain,
6767
GroupId: groupId,
68+
Type: type,
6869
},
6970
}),
7071
}),

src/views/identity/administration/EditGroup.jsx

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,6 @@ const EditGroup = () => {
4242
isSuccess,
4343
} = useListGroupQuery({ tenantDomain, groupId })
4444

45-
const {
46-
data: SenderAuth = {},
47-
isFetching: SenderAuthisFetching,
48-
error: SenderAuthError,
49-
isSuccess: SenderAuthIsSuccess,
50-
} = useListGroupSenderAuthQuery({ tenantDomain, groupId })
51-
5245
const {
5346
data: members = [],
5447
isFetching: membersisFetching,
@@ -96,6 +89,13 @@ const EditGroup = () => {
9689
}
9790
}, [owners, members, ownersIsSuccess, membersIsSuccess, postResults])
9891

92+
const {
93+
data: SenderAuth = {},
94+
isFetching: SenderAuthisFetching,
95+
error: SenderAuthError,
96+
isSuccess: SenderAuthIsSuccess,
97+
} = useListGroupSenderAuthQuery({ tenantDomain, groupId, type: group?.[0]?.calculatedGroupType })
98+
9999
useEffect(() => {
100100
if (!groupId || !tenantDomain) {
101101
ModalService.open({
@@ -166,7 +166,7 @@ const EditGroup = () => {
166166
initialValues={{
167167
...(group[0].calculatedGroupType === 'Microsoft 365' ||
168168
group[0].calculatedGroupType === 'Distribution List'
169-
? { allowExternal: !SenderAuth.enabled }
169+
? { allowExternal: SenderAuth.allowedToReceiveExternal }
170170
: {}),
171171
}}
172172
render={({ handleSubmit, submitting, values }) => {
@@ -323,14 +323,6 @@ const EditGroup = () => {
323323
This is the (raw) information for this group.
324324
<pre>{JSON.stringify(group, null, 2)}</pre>
325325
</div>
326-
<div>
327-
This is the (raw) information for SenderAuth.
328-
{SenderAuthisFetching && <CSpinner />}
329-
{SenderAuthIsSuccess && <pre>{JSON.stringify(SenderAuth, null, 2)}</pre>}
330-
{SenderAuthError && (
331-
<div>Error fetching SenderAuth data: {SenderAuthError.message}</div>
332-
)}
333-
</div>
334326
</>
335327
)}
336328
</CCardBody>

0 commit comments

Comments
 (0)