Skip to content

when I try to save a book I get this error => TypeError: Cannot read property 'catch' of undefined #6

@ghost

Description

Hello, when I try to save a book i get this error,

TypeError: Cannot read property 'catch' of undefined
BookForm._this.onSubmit
C:/code/bookworm/src/components/forms/BookForm.js:55
  52 | this.setState({ errors });
  53 | if (Object.keys(errors).length === 0) {
  54 |   this.setState({ loading: true });
 55 |   this.props
  56 |     .submit(this.state.data)
  57 |     .catch(err =>
  58 |       this.setState({ errors: err.response.data.errors, loading: false })

I run mongo db in cmd windows like this :
C:\Program Files\MongoDB\Server\3.4\bin\mongod --dbpath C:\code\bookworm-api --port 27017

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions