Skip to content
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

Rock - Delia #73

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Rock - Delia #73

wants to merge 3 commits into from

Conversation

Parseluni
Copy link

No description provided.

Copy link
Contributor

@audreyandoy audreyandoy left a comment

Choose a reason for hiding this comment

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

Awesome job Delia!! You hit all the learning goals and completed all the user stories for this project. Overall, your code was well-organized and easy to read. I've added some comments for refactoring and ways to make your logic more robust 💪

Overall, great job and keep up the hard work 🔥 ✨

Comment on lines +128 to +136

if video == None:
return "This video has not been found"

elif video.isalpha():
response = video_store.list_one_video(title=video)
elif video.isdigit():
response = video_store.list_one_video(id=int(video))
Copy link
Contributor

Choose a reason for hiding this comment

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

A good edge case to handle is invalid inputs? Providing some logic that will notify the user about invalid data being entered and then asking to 'Enter a video title or id' again would be really helpful and improve the overall ux of the cli.

Comment on lines +197 to +198
return "This customer has not been found"
Copy link
Contributor

Choose a reason for hiding this comment

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

This particular logic could also expand out to invalid data.

Suggested change
if customer == None:
return "This customer has not been found"
if customer == None:
return "This customer has not been found"


run_cli()

Copy link
Contributor

Choose a reason for hiding this comment

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

Delia! Your main.py file is really neat and easy to read! Great job in separating out the requests from this menu logic.

def make_choice(options):
valid_choices = options.keys()
choice = input("\nPlease select option: ")
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding some detail on how the user can see all the options would be really helpful as the previously displayed menu can get pushed up after doing a few commands.

Suggested change
choice = input("\nPlease select option: ")
choice = input("\nPlease select option or enter 15 to see all options again: ")

Comment on lines +53 to +54
self.selected_video = None
return response.json()
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding some logic to check if the response returns a "video not found" and then printing a message that describes the video not being found would be really helpful to the user.

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently I can type in an invalid video and/or customer and the CLI crashes.

response = requests.get(self.url + f"/videos/{video_id}/rentals")
print(response.text)
return response.json()

Copy link
Contributor

Choose a reason for hiding this comment

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

Great job in separating your requests from main.py. In a future refactor, you could separate customer, rental, and video requests into different files to further modularize your code 😄

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