File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,13 @@ class FormikForm extends Component {
37
37
method : 'POST' ,
38
38
body : data ,
39
39
credentials : 'include'
40
- } ) . then (
41
- data => {
42
- if ( data ) {
43
- window . location . replace ( `/albums/${ values . artist } -${ values . title } ` ) ;
44
- } else {
45
- alert ( 'You entered some invalid data' ) ;
46
- }
47
- } ) ;
40
+ } ) . then ( data => {
41
+ if ( data ) {
42
+ window . location . href = data . url ;
43
+ } else {
44
+ alert ( 'You entered some invalid data' ) ;
45
+ }
46
+ } ) ;
48
47
}
49
48
}
50
49
render = { ( { errors, touched, isSubmitting, setFieldValue } ) => (
@@ -60,12 +59,12 @@ class FormikForm extends Component {
60
59
61
60
< FormGroup >
62
61
< ControlLabel htmlFor = { this . nextUniqueId ( ) } > Album logo</ ControlLabel >
63
- < Field name = "logo " id = { this . lastUniqueId ( ) } type = "file"
62
+ < Field name = "album_logo " id = { this . lastUniqueId ( ) } type = "file"
64
63
className = "form-control-file" onChange = { ( event ) => {
65
64
setFieldValue ( 'file' , event . currentTarget . files [ 0 ] ) ;
66
65
} } />
67
- { touched . logo && errors . logo &&
68
- < HelpBlock style = { { color : 'red' } } > { errors . logo } </ HelpBlock > }
66
+ { touched . album_logo && errors . album_logo &&
67
+ < HelpBlock style = { { color : 'red' } } > { errors . album_logo } </ HelpBlock > }
69
68
</ FormGroup >
70
69
71
70
< Field component = { TagField } name = "tags" onChange = { setFieldValue } />
You can’t perform that action at this time.
0 commit comments