AlexKMarshall / regMan

CRM to manage registrations to summer camps
MIT License
2 stars 0 forks source link

Handle errors in front end api service #8

Open AlexKMarshall opened 4 years ago

AlexKMarshall commented 4 years ago

When I try and register, and it posts to inscriptions this fails with

Uncaught (in promise) Response {type: "basic", url: "http://localhost:3000/undefined/inscriptions", redirected: false, status: 404, ok: false, …}

I'm guessing this is because of something I didn't fill in on the form (probably instrument, as there were no instruments in the database yet).

If that's the case, there should be form validation to stop me trying to submit this form. In either case, the api service should handle server errors such as 404 better and catch them

AlexKMarshall commented 4 years ago

If this is an issue with form validation, should probably just use a library like Formik or react-hook-form to sort that out quickly