Skip to content

Commit

Permalink
Add step index to multistep submission
Browse files Browse the repository at this point in the history
Fixes: AFORM-3800
  • Loading branch information
epi-qang2 committed Dec 18, 2023
1 parent c0b89a8 commit 23ad9c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/@episerver/forms-react/src/components/FormBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export const FormBody = (props: FormBodyProps) => {
partialSubmissionKey: localFormCache.get(FormConstants.FormSubmissionId + form.key) ?? "",
hostedPageUrl: window.location.pathname,
submissionData: formSubmissions,
accessToken: formContext?.identityInfo?.accessToken
accessToken: formContext?.identityInfo?.accessToken,
currentStepIndex: currentStepIndex
}

dispatchFunctions.updateIsSubmitting(true);
Expand Down
5 changes: 5 additions & 0 deletions src/@episerver/forms-sdk/src/form-submit/formSubmit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ export interface FormSubmitModel {
* The access token to identify login user
*/
accessToken?: string;
/**
* The current index of submitted step
*/
currentStepIndex: number;
}

export interface FormSubmitResult {
Expand Down Expand Up @@ -99,6 +103,7 @@ export class FormSubmitter {
formData.append("IsFinalized", model.isFinalized.toString());
formData.append("PartialSubmissionKey", model.partialSubmissionKey);
formData.append("HostedPageUrl", model.hostedPageUrl);
formData.append("CurrentStep", model.currentStepIndex.toString());

//append form submission to FormData object
model.submissionData.forEach(data => {
Expand Down

0 comments on commit 23ad9c1

Please sign in to comment.