-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 188 - Return number of emails contacted #295
Conversation
Codecov Report
@@ Coverage Diff @@
## master #295 +/- ##
==========================================
- Coverage 87.08% 84.43% -2.66%
==========================================
Files 17 17
Lines 635 668 +33
==========================================
+ Hits 553 564 +11
- Misses 82 104 +22
Continue to review full report at Codecov.
|
@ijadams Can you take a look at Michael S feedback and address/respond? Also, can you resolve conflicts? Looking to do housekeeping of PRs to merge/close outstanding PRs. Thanks. |
Maybe could be rebased onto Glazer's https://github.com/CodeForBaltimore/Bmore-Responsive/pull/307/files |
change error type - from code review
changing error status code - from code review
@mschechter-bellese @blakenan-bellese I've made the updates to the error codes that Michael suggested, and also cleaned up the merge conflicts. I'm not sure what to do about the auto-formatting/linting ... I'm trying to get eslint set up in my IDE but am having a hard time, is this something you all use or am I barking up the wrong tree? |
src/routes/contact.js
Outdated
}) | ||
} else { | ||
response.setMessage('Email Address not found.') | ||
response.setCode(500) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is a server error appropriate here? This is a data problem with the specific user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a different status code in mind? Does "422 Unprocessable Entity" make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
422 is definitely something we need to move away from; it's specific to WebDAV and should be only used in those types of cases. 500 is inappropriate because there was no server error at all.
In this case, there's nothing wrong with the provided entity (the request), and the user exists; they just don't have an e-mail address. It's not really clear what this should be because the field is optional. The closest one I can find is that because the resource has missing data we return a 404 with an explanation. This is a short-term solution, as the new API (I think) avoids this scenario entirely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback @mschechter-bellese .. I've changed this status code to 404.
Description
Adding a field for returning the amount of emails the contact/send endpoint sends to
Related PRs
Related Front-End dependency -
CodeForBaltimore/Healthcare-Rollcall#198