Skip to content

Commit

Permalink
Ensure form field's default values are applied (#288)
Browse files Browse the repository at this point in the history
* Ensure form field's default values are applied, fix #276

* correct spelling of "empty"
  • Loading branch information
pro-Nate committed Oct 8, 2020
1 parent 37fbabb commit cb7a6cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/src/events/Create.js
Expand Up @@ -128,6 +128,7 @@ class CreateEvent extends React.Component {

async componentDidMount () {
const form_data = {timezone: Intl.DateTimeFormat().resolvedOptions().timeZone}
EVENT_FIELDS.filter(f => f.hasOwnProperty('default')).forEach(f => form_data[f.name] = f.default)
let data
try {
data = await requests.get('/events/categories/')
Expand Down
2 changes: 1 addition & 1 deletion js/src/forms/Form.js
Expand Up @@ -46,7 +46,7 @@ class _Form extends React.Component {
const errors = {}
missing.forEach(f => {errors[f] = 'Field Required'})
this.setState({
form_error: 'Required fields are emtpy',
form_error: 'Required fields are empty',
errors: errors
})
return
Expand Down

0 comments on commit cb7a6cd

Please sign in to comment.