Get full_name and link to it

This commit is contained in:
Richard Feldman
2016-03-05 07:05:16 -08:00
parent f66fb04de6
commit f18ceff2ca
2 changed files with 9 additions and 4 deletions

View File

@@ -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 ]
]

View File

@@ -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