a7c17ab6f1
Also fixes #187.
15 lines
385 B
Elm
15 lines
385 B
Elm
module Update.Search exposing (update)
|
|
|
|
import Command
|
|
import Types exposing (..)
|
|
|
|
|
|
update : SearchMsg -> Model -> ( Model, Cmd Msg )
|
|
update msg ({ search } as model) =
|
|
case msg of
|
|
SubmitSearch ->
|
|
model ! [ Command.search (List.head model.clients) model.search.term ]
|
|
|
|
UpdateSearch term ->
|
|
{ model | search = { search | term = term } } ! []
|