Get full_name and link to it
This commit is contained in:
@@ -58,7 +58,7 @@ searchResultDecoder =
|
||||
Json.Decode.object3
|
||||
SearchResult
|
||||
("id" := Json.Decode.int)
|
||||
("name" := Json.Decode.string)
|
||||
("full_name" := Json.Decode.string)
|
||||
("stargazers_count" := Json.Decode.int)
|
||||
|
||||
|
||||
@@ -116,7 +116,12 @@ viewSearchResult result =
|
||||
li
|
||||
[]
|
||||
[ span [ class "star-count" ] [ text (toString result.stars) ]
|
||||
, a [ href "", class "result-name" ] [ text result.name ]
|
||||
, a
|
||||
[ href ("https://github.com/" ++ result.name)
|
||||
, class "result-name"
|
||||
, target "_blank"
|
||||
]
|
||||
[ text result.name ]
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ all =
|
||||
<| let
|
||||
response =
|
||||
"""{ "items": [
|
||||
{ "id": 5, "name": "foo", "stargazers_count": 42 },
|
||||
{ "id": 3, "name": "bar", "stargazers_count": 77 }
|
||||
{ "id": 5, "full_name": "foo", "stargazers_count": 42 },
|
||||
{ "id": 3, "full_name": "bar", "stargazers_count": 77 }
|
||||
] }"""
|
||||
in
|
||||
assertEqual
|
||||
|
||||
Reference in New Issue
Block a user