Open
Conversation
spitsfire
reviewed
May 9, 2022
spitsfire
left a comment
There was a problem hiding this comment.
Nicely done, Yonese and Philomena! I didn't find any red flags or any logic issues! Looks good!
Comment on lines
+19
to
+25
| for planet in planets: | ||
| planets_response.append({ | ||
| "id" : planet.id, | ||
| "name" : planet.name, | ||
| "description" : planet.description, | ||
| "habitable" : planet.habitable | ||
| }) |
There was a problem hiding this comment.
this would make a nice instance method for the Planet class
|
|
||
| db.session.commit() | ||
|
|
||
| return make_response(f"Planet {planet.id} successfully updated.") |
There was a problem hiding this comment.
while make_response will send a default code back with the response, it doesn't hurt to get in the habit of controlling our responses in a predictable way. If we sent a response code on line 40, then we should keep doing that will all our routes
| @@ -0,0 +1,43 @@ | |||
| import pytest | |||
| @@ -0,0 +1,42 @@ | |||
| import pytest | |||
Comment on lines
+63
to
+65
| planet.name = request_body["name"] | ||
| planet.description = request_body["description"] | ||
| planet.habitable = request_body["habitable"] |
There was a problem hiding this comment.
we could make this into an instance method as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.