Remove ResultId
This commit is contained in:
@@ -84,16 +84,12 @@ type alias Model =
|
||||
|
||||
|
||||
type alias SearchResult =
|
||||
{ id : ResultId
|
||||
{ id : Int
|
||||
, name : String
|
||||
, stars : Int
|
||||
}
|
||||
|
||||
|
||||
type alias ResultId =
|
||||
Int
|
||||
|
||||
|
||||
initialModel : Model
|
||||
initialModel =
|
||||
{ query = "tutorial"
|
||||
@@ -139,8 +135,7 @@ viewSearchResult result =
|
||||
|
||||
type Msg
|
||||
= SetQuery String
|
||||
| DeleteById ResultId
|
||||
| SetResults (List SearchResult)
|
||||
| DeleteById Int
|
||||
|
||||
|
||||
update : Msg -> Model -> Model
|
||||
@@ -149,13 +144,6 @@ update msg model =
|
||||
SetQuery query ->
|
||||
{ model | query = query }
|
||||
|
||||
SetResults results ->
|
||||
let
|
||||
newModel =
|
||||
{ model | results = results }
|
||||
in
|
||||
newModel
|
||||
|
||||
DeleteById idToHide ->
|
||||
let
|
||||
newResults =
|
||||
|
||||
Reference in New Issue
Block a user