-
Notifications
You must be signed in to change notification settings - Fork 61
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
Shark - Yonese and Philomena #18
base: main
Are you sure you want to change the base?
Conversation
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.
Nicely done, Yonese and Philomena! I didn't find any red flags or any logic issues! Looks good!
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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.
👍
@@ -0,0 +1,42 @@ | |||
import pytest |
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.
👍
planet.name = request_body["name"] | ||
planet.description = request_body["description"] | ||
planet.habitable = request_body["habitable"] |
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.
we could make this into an instance method as well
No description provided.