Add default case in sortArguments#99
Add default case in sortArguments#99mndominguez wants to merge 2 commits intocodebuddies:developmentfrom
Conversation
stain88
left a comment
There was a problem hiding this comment.
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."
This fixes #90