/** * @flow * @file Form to invoke an integration via POST * @author Box */ import React, { PureComponent } from 'react'; import { HTTP_POST } from '../../constants'; import type { ExecuteAPI } from '../../common/types/integrations'; type Props = { executePostData: ExecuteAPI, id: string, onSubmit: Function, windowName: ?string, }; class ExecuteForm extends PureComponent { ref: any; constructor(props: Props) { super(props); this.ref = React.createRef(); } componentDidMount() { const { onSubmit }: Props = this.props; this.ref.current.submit(); onSubmit(); } render() { const { executePostData: { url, params }, id, windowName, }: Props = this.props; return (
{params && params.map(({ key, value }) => )}
); } } export default ExecuteForm;