Change from comma-separated query param to repeated query params (refactor 2 in preparation for Typescript). #97
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The previous state (comma-separated) was troublesome with authors, which always include commas, which led to a bunch of fragile special casing (see #87) and the inability to handle multiple author filters. Alternatives considered were URL encoding everything and using a non-comma separator (using some unreserved char like _, -, or ~). Vue router documentation was not clear w.r.t. the behavior of URL encoding (lots of references to automatic encoding as in here but our commas weren't getting encoded) and this seemed preferable to non-comma separation.
With this change, URLs for multiple authors look like
search?publication-author=Adamovich,+Aleksandra+I&publication-author=Shendure,+Jay
(note the change from plural to singular, which is more accurate now) which are handled quite nicely by the vue router as arrays. There's a little bit of careful code around parsing, but that's mostly to satisfy typescript.