Skip to content

Shark - Yonese and Philomena#18

Open
yonesejames wants to merge 5 commits intoada-c17:mainfrom
Philomena-Kelly:main
Open

Shark - Yonese and Philomena#18
yonesejames wants to merge 5 commits intoada-c17:mainfrom
Philomena-Kelly:main

Conversation

@yonesejames
Copy link
Copy Markdown

No description provided.

@yonesejames yonesejames changed the title Shark - Yonese J. Shark - Yonese and Philomena Apr 26, 2022
Copy link
Copy Markdown

@spitsfire spitsfire left a 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!

Comment thread app/routes.py
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
})
Copy link
Copy Markdown

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

Comment thread app/routes.py

db.session.commit()

return make_response(f"Planet {planet.id} successfully updated.")
Copy link
Copy Markdown

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

Comment thread tests/conftest.py
@@ -0,0 +1,43 @@
import pytest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread tests/test_routes.py
@@ -0,0 +1,42 @@
import pytest
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread app/routes.py
Comment on lines +63 to +65
planet.name = request_body["name"]
planet.description = request_body["description"]
planet.habitable = request_body["habitable"]
Copy link
Copy Markdown

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants