Updated gradebookServer.js DB function names to match #45 + Misc. fixes#50
Updated gradebookServer.js DB function names to match #45 + Misc. fixes#50
Conversation
Instructor REST calls now use the updated DB function names (From #45) The login failed message now sends the correct error code (401) Added a check for blank attendance sheets - if no records are found, a 500 error is sent Updated the attendance function to use the correct column name from the DB
|
The changes look good. A minor point: The comment on L138 should probably be stated more like the comment on L299 (because the function will not have returned any row). |
|
L300 (was L299) has the correct comment (but for the spelling error in the last word): The comment on L138 |
|
Overall, changes look good. However the new check on line 139, It seems like the check relies on receiving a table with (at least) 1 row with (at least) I am not too familiar with the behavior of the |
|
Thanks @afig for sharing your observation on handling a result set with no rows. I did question the current implementation in my own mind, but chose to not ask for I wasn't aware of the details of the This kinds of situations is why I like at least two approvals to every PR and like every review to be careful and analytical. This attitude is also why and how teams fare better. So, a big thank you to all contributors who are making this development such an enjoyable and educational effort. |
The cardinality of the result rows is now used in the /attendance and /login calls to check if a result was found or not.
|
Thanks for the review. I just pushed a commit that changes the approach when checking for returned data from the I agree that a similar check should be added to all the REST functions, however I think we may want to consider how the functions behave when no data is returned. Currently, I can integrate this change into this branch, I can create an issue and address it after M1. |
|
I also improved the comments related to the return checking and made them reflect the current implementation. |
smurthys
left a comment
There was a problem hiding this comment.
Nice work @srrollo. These changes look good to go.
smurthys
left a comment
There was a problem hiding this comment.
Sorry, I again forgot to select the Approve option in my last attempt.
afig
left a comment
There was a problem hiding this comment.
Changes look good, thanks.
As far as checking for all queries goes, I think it would be best to add an issue and perform the changes after M1, considering the approaching deadline and the possibility of further changes to the return value of functions.
This pull request fixes a couple items in
gradebookServer.js. This PR updates some function names based on changes in #45, so this PR must be merged after #45.