Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b592a98ccefb
Choose a base ref
...
head repository: NixOS/nixos-search
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 83863c2de1e0
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 29, 2020

  1. simplify further

    turboMaCk committed Oct 29, 2020
    Copy the full SHA
    83863c2 View commit details
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/Route.elm
11 changes: 4 additions & 7 deletions src/Route.elm
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@ import Url.Parser.Query


type alias SearchArgs =
{ channel : Maybe String
, query : Maybe SearchQuery
{ query : Maybe SearchQuery
, channel : Maybe String
, show : Maybe String
, from : Maybe Int
, size : Maybe Int
@@ -44,12 +44,9 @@ searchQueryParser url =
rawQuery =
Route.SearchQuery.toRawQuery url

withSearchQuery : (a -> Maybe SearchQuery -> b) -> a -> b
withSearchQuery f channel =
f channel <|
Maybe.andThen (Route.SearchQuery.searchString "query") rawQuery
maybeQuery = Maybe.andThen (Route.SearchQuery.searchString "query") rawQuery
in
Url.Parser.map (withSearchQuery SearchArgs) <|
Url.Parser.map (SearchArgs maybeQuery) <|
Url.Parser.top
<?> Url.Parser.Query.string "channel"
<?> Url.Parser.Query.string "show"