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