Skip to content

Commit

Permalink
Cleanup queries in Mailbox Settings
Browse files Browse the repository at this point in the history
- Change forwarding to look at proxyAddresses instead of mail
- Remove extra queries
  • Loading branch information
JohnDuprey committed Aug 29, 2024
1 parent 8a04e24 commit fae4360
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions src/views/email-exchange/administration/EditMailboxPermissions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const MailboxPermissions = () => {
params: {
Endpoint: 'users',
TenantFilter: tenantDomain,
$filter: 'assignedLicenses/$count ne 0 and accountEnabled eq true',
$filter: "assignedLicenses/$count ne 0 and accountEnabled eq true and userType eq 'Member'",
$count: true,
},
})
Expand Down Expand Up @@ -586,7 +586,7 @@ const MailboxForwarding = () => {
params: {
Endpoint: 'users',
TenantFilter: tenantDomain,
$filter: "userType eq 'Member' and mail ge ' '", // filter out guests and users with no mailbox. #HACK "mail ne 'null'" does not work so this horrible hack is required
$filter: "userType eq 'Member' and proxyAddresses/$count ne 0",
},
})
useEffect(() => {
Expand Down Expand Up @@ -803,19 +803,6 @@ const OutOfOffice = () => {
error: userError,
} = useListMailboxPermissionsQuery({ tenantDomain, userId })

const {
data: users = [],
isFetching: usersIsFetching,
error: usersError,
} = useGenericGetRequestQuery({
path: '/api/ListGraphRequest',
params: {
Endpoint: 'users',
TenantFilter: tenantDomain,
$filter: 'assignedLicenses/$count ne 0 and accountEnabled eq true',
$count: true,
},
})
useEffect(() => {
if (postResults.isSuccess) {
// @TODO do something here?
Expand Down Expand Up @@ -865,9 +852,9 @@ const OutOfOffice = () => {
)}
<CRow>
<CCol className="mb-3">
{usersIsFetching && <CSpinner />}
{userIsFetching && <CSpinner />}
{userError && <span>Error loading user</span>}
{!usersIsFetching && (
{!userIsFetching && (
<Form
initialValues={{ ...initialState }}
onSubmit={onSubmit}
Expand Down

0 comments on commit fae4360

Please sign in to comment.