s/Hide/Delete/g
This commit is contained in:
@@ -90,7 +90,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
-- TODO add an onClick handler that sends a HIDE_BY_ID action
|
||||
-- TODO add an onClick handler that sends a DELETE_BY_ID action
|
||||
[ class "hide-result" ]
|
||||
[ text "X" ]
|
||||
]
|
||||
@@ -103,6 +103,6 @@ type alias Action =
|
||||
|
||||
update : Action -> Model -> Model
|
||||
update action model =
|
||||
-- TODO if we receive a HIDE_BY_ID action,
|
||||
-- TODO if we receive a DELETE_BY_ID action,
|
||||
-- build a new model without the given ID present anymore.
|
||||
model
|
||||
|
||||
@@ -111,7 +111,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
-- TODO add an onClick handler that sends a HideById action
|
||||
-- TODO add an onClick handler that sends a DeleteById action
|
||||
[ class "hide-result" ]
|
||||
[ text "X" ]
|
||||
]
|
||||
@@ -119,19 +119,11 @@ viewSearchResult address result =
|
||||
|
||||
type Action
|
||||
= SetQuery String
|
||||
| HideById ResultId
|
||||
| DeleteById ResultId
|
||||
|
||||
|
||||
update : Action -> Model -> ( Model, Effects Action )
|
||||
update action model =
|
||||
case action of
|
||||
SetQuery query ->
|
||||
( { model | query = query }, Effects.none )
|
||||
|
||||
HideById idToHide ->
|
||||
let
|
||||
-- TODO build a new model without the given ID present anymore.
|
||||
newModel =
|
||||
model
|
||||
in
|
||||
( newModel, Effects.none )
|
||||
-- TODO write a case-expression that makes SetQuery set the query
|
||||
-- and DeleteById delete the appropriate result
|
||||
( model, Effects.none )
|
||||
|
||||
@@ -123,7 +123,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
[ class "hide-result", onClick address (HideById result.id) ]
|
||||
[ class "hide-result", onClick address (DeleteById result.id) ]
|
||||
[ text "X" ]
|
||||
]
|
||||
|
||||
@@ -131,7 +131,7 @@ viewSearchResult address result =
|
||||
type Action
|
||||
= Search
|
||||
| SetQuery String
|
||||
| HideById ResultId
|
||||
| DeleteById ResultId
|
||||
| SetResults (List SearchResult)
|
||||
|
||||
|
||||
@@ -151,7 +151,7 @@ update action model =
|
||||
in
|
||||
( newModel, Effects.none )
|
||||
|
||||
HideById idToHide ->
|
||||
DeleteById idToHide ->
|
||||
let
|
||||
newResults =
|
||||
List.filter (\{ id } -> id /= idToHide) model.results
|
||||
|
||||
@@ -101,7 +101,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
[ class "hide-result", onClick address (HideById result.id) ]
|
||||
[ class "hide-result", onClick address (DeleteById result.id) ]
|
||||
[ text "X" ]
|
||||
]
|
||||
|
||||
@@ -109,7 +109,7 @@ viewSearchResult address result =
|
||||
type Action
|
||||
= Search
|
||||
| SetQuery String
|
||||
| HideById ResultId
|
||||
| DeleteById ResultId
|
||||
| SetResults (List SearchResult)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ update action model =
|
||||
in
|
||||
( newModel, Effects.none )
|
||||
|
||||
HideById idToHide ->
|
||||
DeleteById idToHide ->
|
||||
let
|
||||
newResults =
|
||||
model.results
|
||||
|
||||
@@ -101,7 +101,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
[ class "hide-result", onClick address (HideById result.id) ]
|
||||
[ class "hide-result", onClick address (DeleteById result.id) ]
|
||||
[ text "X" ]
|
||||
]
|
||||
|
||||
@@ -109,7 +109,7 @@ viewSearchResult address result =
|
||||
type Action
|
||||
= Search
|
||||
| SetQuery String
|
||||
| HideById ResultId
|
||||
| DeleteById ResultId
|
||||
| SetResults (List SearchResult)
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ update action model =
|
||||
in
|
||||
( newModel, Effects.none )
|
||||
|
||||
HideById idToHide ->
|
||||
DeleteById idToHide ->
|
||||
let
|
||||
newResults =
|
||||
model.results
|
||||
|
||||
@@ -103,7 +103,7 @@ viewSearchResult address result =
|
||||
]
|
||||
[ text result.name ]
|
||||
, button
|
||||
[ class "hide-result", onClick address (HideById result.id) ]
|
||||
[ class "hide-result", onClick address (DeleteById result.id) ]
|
||||
[ text "X" ]
|
||||
]
|
||||
|
||||
@@ -111,7 +111,7 @@ viewSearchResult address result =
|
||||
type Action
|
||||
= Search
|
||||
| SetQuery String
|
||||
| HideById ResultId
|
||||
| DeleteById ResultId
|
||||
| SetResults (List SearchResult)
|
||||
| DoNothing
|
||||
|
||||
@@ -132,7 +132,7 @@ update searchAddress action model =
|
||||
in
|
||||
( newModel, Effects.none )
|
||||
|
||||
HideById idToHide ->
|
||||
DeleteById idToHide ->
|
||||
let
|
||||
newResults =
|
||||
model.results
|
||||
|
||||
Reference in New Issue
Block a user