Skip to content

Commit

Permalink
[JSS][Forms] Assign Sitecore.Context.Item in Forms submit actions on …
Browse files Browse the repository at this point in the history
…a JSS Forms submit (#386)
  • Loading branch information
sc-illiakovalenko authored Jun 19, 2020
1 parent efe3ecf commit 05facc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/sitecore-jss-forms/src/SitecoreForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { HtmlFormField } from './HtmlFormField';
/** The model returned from the Sitecore Forms JSON API for a form schema */
export interface SitecoreForm {
htmlPrefix: string;
contextItemId: string;
formSessionId: HtmlFormField;
formItemId: HtmlFormField;
pageItemId: HtmlFormField;
Expand Down
2 changes: 1 addition & 1 deletion packages/sitecore-jss-react-forms/src/components/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Form extends Component<FormProps, FormState & FieldStateCollection>
return (<div>Form data invalid. Forget to set the rendering contents resolver?</div>);
}

const action = `${this.props.sitecoreApiHost}/api/jss/formbuilder?fxb.FormItemId=${form.metadata.itemId}&fxb.HtmlPrefix=${form.htmlPrefix}&sc_apikey=${this.props.sitecoreApiKey}`;
const action = `${this.props.sitecoreApiHost}/api/jss/formbuilder?fxb.FormItemId=${form.metadata.itemId}&fxb.HtmlPrefix=${form.htmlPrefix}&sc_apikey=${this.props.sitecoreApiKey}&sc_itemid=${form.contextItemId}`;

this._tracker.setFormData(form.formItemId.value, form.formSessionId.value, form.metadata.isTrackingEnabled);

Expand Down

0 comments on commit 05facc3

Please sign in to comment.