Skip to content

Commit

Permalink
Merge pull request KelvinTegelaar#2580 from JohnDuprey/dev
Browse files Browse the repository at this point in the history
JIT Update users query to ListGraphRequest
  • Loading branch information
JohnDuprey committed Jun 21, 2024
2 parents 0a07a10 + 1e6c6f6 commit 7f00c72
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/views/identity/administration/DeployJITAdmin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ import {
RFFCFormSwitch,
RFFSelectSearch,
} from 'src/components/forms'
import { useLazyGenericGetRequestQuery, useLazyGenericPostRequestQuery } from 'src/store/api/app'
import {
useGenericGetRequestQuery,
useLazyGenericGetRequestQuery,
useLazyGenericPostRequestQuery,
} from 'src/store/api/app'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faCircleNotch, faEdit, faEye } from '@fortawesome/free-solid-svg-icons'
import { CippContentCard, CippPage, CippPageList } from 'src/components/layout'
Expand Down Expand Up @@ -63,7 +67,16 @@ const DeployJITAdmin = () => {
data: users = [],
isFetching: usersIsFetching,
error: usersError,
} = useListUsersQuery({ tenantDomain })
} = useGenericGetRequestQuery({
path: '/api/ListGraphRequest',
params: {
TenantFilter: tenantDomain,
Endpoint: 'users',
$select: 'id,displayName,userPrincipalName,accountEnabled',
$count: true,
$top: 999,
},
})
return (
<CippPage title={`Add JIT Admin`} tenantSelector={false}>
Expand Down Expand Up @@ -130,7 +143,7 @@ const DeployJITAdmin = () => {
<CCol>
<RFFSelectSearch
label={'Users in ' + tenantDomain}
values={users?.map((user) => ({
values={users?.Results?.map((user) => ({
value: user.id,
name: `${user.displayName} <${user.userPrincipalName}>`,
}))}
Expand All @@ -140,7 +153,7 @@ const DeployJITAdmin = () => {
/>
<FormSpy subscription={{ values: true }}>
{({ values }) => {
return users.map((user, key) => {
return users?.Results?.map((user, key) => {
if (
user.id === values?.UserId?.value &&
user.accountEnabled === false
Expand Down

0 comments on commit 7f00c72

Please sign in to comment.