Closed ckoster22 closed 7 years ago
Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!
Here is what to expect next, and if anyone wants to comment, keep these things in mind.
Closing this issue as this was a problem with mocking a Location
specifically for parsePath
. Correctly mocking the search string yielded expected results.
> parsePath (s "blog" <?> stringParam "search") (Location "" "" "" "" "" "" "/blog" "?search=cats" "" "" "")
Just (Just "cats") : Maybe.Maybe (Maybe.Maybe String)
However, this will only work with parsePath
. It appears that if you attempt to use query parameters with parseHash
the UrlParser.*param functions do not work because the Navigation.Location groups the hash and query string together into the hash
attribute, rather than splitting out the query string into the search
attribute on Location
.
I'm attempting to figure out how to parse a path or hash with multiple query parameters, something like a
(<&>)
function. In going through the docs I noticed several examples with query parameters do not work. For example, the following code from the (\<?>) example does not work in Elm repl:This is an incremental step in working up to an example with a path like "/blog?search=cats&order=desc". Guidance on parsing multiple query parameters would also be appreciated.