diff --git a/src/views/tenant/administration/GDAPInviteWizard.jsx b/src/views/tenant/administration/GDAPInviteWizard.jsx index 34b8dfad775e..23fa60e962e6 100644 --- a/src/views/tenant/administration/GDAPInviteWizard.jsx +++ b/src/views/tenant/administration/GDAPInviteWizard.jsx @@ -1,5 +1,14 @@ -import React from 'react' -import { CCol, CRow, CForm, CCallout, CSpinner, CButton } from '@coreui/react' +import React, { useState } from 'react' +import { + CCol, + CRow, + CForm, + CCallout, + CSpinner, + CFormInput, + CFormLabel, + CFormRange, +} from '@coreui/react' import { Field, FormSpy } from 'react-final-form' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons' @@ -32,11 +41,21 @@ Error.propTypes = { const requiredArray = (value) => (value && value.length !== 0 ? undefined : 'Required') const GDAPInviteWizard = () => { + const [inviteCount, setInviteCount] = useState(1) + const [loopRunning, setLoopRunning] = React.useState(false) + const [massResults, setMassResults] = React.useState([]) const [genericPostRequest, postResults] = useLazyGenericPostRequestQuery() const [genericGetRequest, getResults] = useLazyGenericGetRequestQuery() const handleSubmit = async (values) => { - genericPostRequest({ path: '/api/ExecGDAPInvite', values: values }) + const resultsarr = [] + setLoopRunning(true) + for (var x = 0; x < inviteCount; x++) { + const results = await genericPostRequest({ path: '/api/ExecGDAPInvite', values: values }) + resultsarr.push(results) + setMassResults(resultsarr) + } + setLoopRunning(false) } const formValues = {} @@ -95,13 +114,40 @@ const GDAPInviteWizard = () => {