Skip to content
Snippets Groups Projects
Commit a217e067 authored by Tore.Brede's avatar Tore.Brede
Browse files

The submitState state is not used, so removing it

parent 1194e19c
No related branches found
No related tags found
1 merge request!202GREG-139: Feedback for guest registration error
......@@ -25,12 +25,6 @@ import ServerErrorReport, {
ErrorReportProps,
} from '../../../components/errorReport'
enum SubmitState {
NotSubmitted,
Submitted,
SubmittedError,
}
enum Step {
RegisterStep,
ConsentStep,
......@@ -75,11 +69,6 @@ export default function GuestRegister() {
const guestRegisterRef = useRef<GuestRegisterCallableMethods>(null)
const guestConsentRef = useRef<GuestRegisterCallableMethods>(null)
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const [submitState, setSubmitState] = useState<SubmitState>(
SubmitState.NotSubmitted
)
const [activeStep, setActiveStep] = useState(0)
const [initialGuestData, setInitialGuestData] =
......@@ -286,7 +275,6 @@ export default function GuestRegister() {
fetch('/api/ui/v1/invited/', submitJsonOpts('POST', payload))
.then((response) => {
if (response.ok) {
setSubmitState(SubmitState.Submitted)
setActiveStep(Step.SuccessStep)
} else {
// Expect that the error will contain JSON-data in the body
......@@ -313,9 +301,6 @@ export default function GuestRegister() {
errorBodyText: undefined,
})
})
.finally(() => {
setSubmitState(SubmitState.SubmittedError)
})
}
})
.catch((error) => {
......@@ -326,7 +311,6 @@ export default function GuestRegister() {
statusText: undefined,
errorBodyText: undefined,
})
setSubmitState(SubmitState.SubmittedError)
console.error(error)
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment