CodeForPhilly / prevention-point

Current Functional Product
MIT License
30 stars 15 forks source link

Implemented snackbar on auth and queue stores. #471

Closed JackRyan1989 closed 3 years ago

JackRyan1989 commented 3 years ago

Couple o' q's:

  1. The handleError fn is not generating a message or severity properties with the errors I am passing in via auth and queue stores. As a result, I'm sending just the variable "snackbarError", which is a string, to the setSnackBar state action. For severity, I'm setting that to a string, "error", manually. Is handleError going to be worked on so it will always generate message and severity properties? If so, I can just put those in place in preparation for those changes.
  2. I noticed that Notification store has a setSnackBar state action as well that doesn't have severity integrated. Should that action be removed?

Thanks!

MikeyManoguerra commented 3 years ago

The issue here is you are using handleError and not handleSnackbarError from the error handlers module.

This is definitely confusing setup however.

Really, handleSnackbarError should be handleApiError, and handleError should be removed. This error mapping normalizer function only works when its passed a status code, so client/browser only errors using the snackbar should not use this this function. They can be handled on a case by case basis, in lieu of writing a client error handler mapper