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

feat(passenger-count): specify number of passengers #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat(passenger-count): specify number of passengers #11

wants to merge 1 commit into from

Conversation

adamstankiewicz
Copy link

@adamstankiewicz adamstankiewicz commented Apr 21, 2018

Adds the ability to specify the number of passengers for a flight, defaulting to 1 (see #4)

import inquirer from 'inquirer';

const isValidPassengerCount = (passengerCount) => {
if (!Number.isNaN(parseFloat(passengerCount))
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe using the is-number npm library will create less overhead?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I was just using the convention in selectMaximumPrice.js. Maybe it's worth using is-number there, too.

Copy link
Owner

Choose a reason for hiding this comment

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

image

FYI from our conversation earlier today

https://runkit.com/embed/wvtjk3ybiupl

&& parseFloat(passengerCount) >= 1) {
return true;
}
return 'Please enter at least one passenger';
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe Please enter a positive number of passengers?

@jaebradley
Copy link
Owner

Logic looks good, can you add screenshots for verifying that this works locally?

@@ -1,5 +1,5 @@
{
"name": "flights-searcher-cli",
"name": "flights-search-cli",
Copy link
Owner

Choose a reason for hiding this comment

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

There shouldn't be a package-lock.json change without a corresponding change to package.json.

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.

None yet

2 participants