mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-24 06:54:03 +03:00
Fix example.
This commit is contained in:
parent
a9c9b69031
commit
e0d949c008
@ -53,7 +53,7 @@ routes getStaticRoutes htmlToString =
|
||||
)
|
||||
, ApiRoute.succeed
|
||||
(\repoName ->
|
||||
BackendTask.Http.get
|
||||
BackendTask.Http.getJson
|
||||
("https://api.github.com/repos/dillonkearns/" ++ repoName)
|
||||
(Decode.field "stargazers_count" Decode.int)
|
||||
|> BackendTask.map
|
||||
|
@ -142,7 +142,7 @@ pages =
|
||||
|
||||
data : RouteParams -> BackendTask Data
|
||||
data routeParams =
|
||||
BackendTask.Http.get
|
||||
BackendTask.Http.getJson
|
||||
(Secrets.succeed "https://api.github.com/repos/dillonkearns/elm-pages")
|
||||
(Decode.field "stargazer_count" Decode.int)
|
||||
|
||||
@ -189,7 +189,7 @@ all =
|
||||
|
||||
repo : String -> BackendTask Repo
|
||||
repo repoName =
|
||||
BackendTask.Http.get (Secrets.succeed ("https://api.github.com/repos/dillonkearns/" ++ repoName))
|
||||
BackendTask.Http.getJson (Secrets.succeed ("https://api.github.com/repos/dillonkearns/" ++ repoName))
|
||||
(OptimizedDecoder.map Repo
|
||||
(OptimizedDecoder.field "stargazers_count" OptimizedDecoder.int)
|
||||
)
|
||||
@ -240,7 +240,7 @@ head static =
|
||||
|
||||
data : RouteParams -> BackendTask Data
|
||||
data routeParams =
|
||||
BackendTask.Http.get
|
||||
BackendTask.Http.getJson
|
||||
(Secrets.succeed "https://api.github.com/repos/dillonkearns/elm-pages")
|
||||
(OptimizedDecoder.field "stargazer_count" OptimizedDecoder.int)
|
||||
|
||||
|
@ -50,6 +50,7 @@ staticRequest =
|
||||
, method = "GET"
|
||||
, headers = [ ( "Authorization", "Bearer " ++ airtableToken ), ( "view", "viwayJBsr63qRd7q3" ) ]
|
||||
, body = BackendTask.Http.emptyBody
|
||||
, options = Nothing
|
||||
}
|
||||
(BackendTask.Http.expectJson decoder)
|
||||
|> BackendTask.throw
|
||||
|
Loading…
Reference in New Issue
Block a user