From 7b48299415eb00fdd16987784ac784c337ebbc55 Mon Sep 17 00:00:00 2001 From: KelvinTegelaar Date: Tue, 26 Sep 2023 18:24:02 +0200 Subject: [PATCH] add refresh to groups --- src/views/identity/administration/EditGroup.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/views/identity/administration/EditGroup.js b/src/views/identity/administration/EditGroup.js index 9ea8160b396a..1c9e2d44d187 100644 --- a/src/views/identity/administration/EditGroup.js +++ b/src/views/identity/administration/EditGroup.js @@ -32,9 +32,8 @@ const EditGroup = () => { let query = useQuery() const groupId = query.get('groupId') const tenantDomain = query.get('tenantDomain') - const [queryError, setQueryError] = useState(false) - + const [refreshToken, setRefresh] = useState('') const { data: group = {}, isFetching, @@ -47,14 +46,14 @@ const EditGroup = () => { isFetching: membersisFetching, error: membersError, isSuccess: membersIsSuccess, - } = useListGroupMembersQuery({ tenantDomain, groupId }) + } = useListGroupMembersQuery({ tenantDomain, groupId, refreshToken }) const { data: owners = [], isFetching: ownersisFetching, error: ownersError, isSuccess: ownersIsSuccess, - } = useListGroupOwnersQuery({ tenantDomain, groupId }) + } = useListGroupOwnersQuery({ tenantDomain, groupId, refreshToken }) const { data: users = [], isFetching: usersIsFetching, @@ -66,6 +65,7 @@ const EditGroup = () => { isFetching: contactsIsFetching, error: contactsError, } = useListContactsQuery({ tenantDomain }) + const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const [roleInfo, setroleInfo] = React.useState([]) useEffect(() => { @@ -86,7 +86,7 @@ const EditGroup = () => { }) setroleInfo(ownerWithRole.concat(memberwithRole)) } - }, [owners, members, ownersIsSuccess, membersIsSuccess]) + }, [owners, members, ownersIsSuccess, membersIsSuccess, postResults]) useEffect(() => { if (!groupId || !tenantDomain) { @@ -97,7 +97,6 @@ const EditGroup = () => { setQueryError(true) } }, [groupId, tenantDomain, dispatch]) - const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const onSubmit = (values) => { const shippedValues = { tenantID: tenantDomain, @@ -114,7 +113,9 @@ const EditGroup = () => { mail: group[0].mail, } //window.alert(JSON.stringify(shippedValues)) - genericPostRequest({ path: '/api/EditGroup', values: shippedValues }) + genericPostRequest({ path: '/api/EditGroup', values: shippedValues }).then((res) => { + setRefresh(postResults.requestId) + }) } const tableColumns = [ {