Skip to content

Commit b348d35

Browse files
committed
prop names
1 parent ef649f5 commit b348d35

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

server/client/src/actions/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ export const handleToken = token => async dispatch => {
1212

1313
dispatch({ type: FETCH_USER, payload: res.data });
1414
};
15+
16+
export const submitSurvey = values => async dispatch => {
17+
const res = await axios.post('/api/surveys', values);
18+
19+
dispatch({ type: FETCH_USER, payload: res.data });
20+
};

server/client/src/components/surveys/SurveyForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class SurveyForm extends Component {
4343
function validate(values) {
4444
const errors = {};
4545

46-
errors.emails = validateEmails(values.emails || '');
46+
errors.recipients = validateEmails(values.recipients || '');
4747

4848
_.each(formFields, ({ name }) => {
4949
if (!values[name]) {

server/client/src/components/surveys/formFields.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ export default [
22
{ label: 'Campaign Title', name: 'title' },
33
{ label: 'Subject Line', name: 'subject' },
44
{ label: 'Email Body', name: 'body' },
5-
{ label: 'Recipient List', name: 'emails' }
5+
{ label: 'Recipient List', name: 'recipients' }
66
];

0 commit comments

Comments
 (0)