diff --git a/src/actions/index.js b/src/actions/index.js index 5a18fa6..43af611 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1,24 +1,24 @@ /** - * emailNotification actions. - * @module actions/emailNotification/emailNotification + * submitForm actions. + * @module actions/submitForm */ -export const EMAIL_SEND_ACTION_FORM = 'EMAIL_SEND_ACTION_FORM'; +export const SUBMIT_FORM_ACTION = 'SUBMIT_FORM_ACTION'; /** - * Email send function - * @function sendActionForm + * submitForm function + * @function submitForm * @param {string} pat * @param {string} block_id * @param {Object} data * @returns {Object} attachments */ -export function sendActionForm(path = '', block_id, data, attachments) { +export function submitForm(path = '', block_id, data, attachments) { return { - type: EMAIL_SEND_ACTION_FORM, + type: SUBMIT_FORM_ACTION, request: { op: 'post', - path: path + '/@send-action-form', + path: path + '/@submit-form', data: { block_id, data, diff --git a/src/components/Form.jsx b/src/components/Form.jsx index 37dc2d7..c0d97f2 100644 --- a/src/components/Form.jsx +++ b/src/components/Form.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, useReducer } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import PropTypes from 'prop-types'; import { useIntl, defineMessages } from 'react-intl'; -import { sendActionForm } from '../actions'; +import { submitForm } from '../actions'; import { getFieldName } from './utils'; import FormView from './FormView'; @@ -107,7 +107,7 @@ const Form = ({ data, id, path }) => { }); dispatch( - sendActionForm( + submitForm( path, id, Object.keys(formData).map((name) => ({