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

Add default case in sortArguments #99

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

mndominguez
Copy link

This fixes #90

Copy link
Collaborator

@stain88 stain88 left a comment

Choose a reason for hiding this comment

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

Hmm, I don't think this is enough, actually (probably due to the poor way I've set it up).
Since we're not adding/changing anything, we're still returning an empty {} for returnArgs, which means that when we get to here, the full list is returned.

I realise the test passes, but again, doesn't mean I've coded it right 😕

One hacky fix I can think of is to push a "fake" element into one of the arrays, like languages.push('typo');, but a better fix is possibly to set up a Boolean variable, if we reach the default case, toggle that to true, add it to returnArgs, and then in resources.js, add another if case to check for this boolean. If true, the message returned should be something along the lines of "Oops, we couldn't find any resources you've asked for."

@stain88 stain88 requested a review from angelocordon October 3, 2018 08:50
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.

A bogus command returns all resources instead of empty
2 participants