Skip to content

Commit

Permalink
prop names
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenGrider committed Jul 20, 2019
1 parent a635c5c commit ef94c13
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions server/client/src/actions/index.js
Expand Up @@ -12,3 +12,9 @@ export const handleToken = token => async dispatch => {

dispatch({ type: FETCH_USER, payload: res.data });
};

export const submitSurvey = values => async dispatch => {
const res = await axios.post('/api/surveys', values);

dispatch({ type: FETCH_USER, payload: res.data });
};
2 changes: 1 addition & 1 deletion server/client/src/components/surveys/SurveyForm.js
Expand Up @@ -43,7 +43,7 @@ class SurveyForm extends Component {
function validate(values) {
const errors = {};

errors.emails = validateEmails(values.emails || '');
errors.recipients = validateEmails(values.recipients || '');

_.each(formFields, ({ name }) => {
if (!values[name]) {
Expand Down
2 changes: 1 addition & 1 deletion server/client/src/components/surveys/formFields.js
Expand Up @@ -2,5 +2,5 @@ export default [
{ label: 'Campaign Title', name: 'title' },
{ label: 'Subject Line', name: 'subject' },
{ label: 'Email Body', name: 'body' },
{ label: 'Recipient List', name: 'emails' }
{ label: 'Recipient List', name: 'recipients' }
];

0 comments on commit ef94c13

Please sign in to comment.