File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff 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+ } ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ class SurveyForm extends Component {
4343function 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 ] ) {
Original file line number Diff line number Diff 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] ;
You can’t perform that action at this time.
0 commit comments