Remove unused.

This commit is contained in:
Dillon Kearns 2022-04-28 11:59:08 -07:00
parent 0dac6a0916
commit cc30fc028a
2 changed files with 0 additions and 52 deletions

View File

@ -527,7 +527,6 @@ config =
.filter((segment) => segment !== "")
.map((segment) => `"${segment}"`)
.join(", ")} ]
, fetchPageData = fetchPageData
, sendPageData = sendPageData
, byteEncodePageData = byteEncodePageData
, byteDecodePageData = byteDecodePageData
@ -587,56 +586,6 @@ ${templates
port sendPageData : Pages.Internal.Platform.ToJsPayload.NewThingForPort -> Cmd msg
fetchPageData : Url -> Maybe { contentType : String, body : String } -> Task Http.Error ( Url, ResponseSketch PageData Shared.Data )
fetchPageData url details =
Http.task
{ method = details |> Maybe.map (\\_ -> "POST") |> Maybe.withDefault "GET"
, headers = []
, url =
url.path
|> Pages.Internal.String.chopForwardSlashes
|> String.split "/"
|> List.filter ((/=) "")
|> (\\l -> l ++ [ "content.dat" ])
|> String.join "/"
|> String.append "/"
, body = details |> Maybe.map (\\justDetails -> Http.stringBody justDetails.contentType justDetails.body) |> Maybe.withDefault Http.emptyBody
, resolver =
Http.bytesResolver
(\\response ->
case response of
Http.BadUrl_ url_ ->
Err (Http.BadUrl url_)
Http.Timeout_ ->
Err Http.Timeout
Http.NetworkError_ ->
Err Http.NetworkError
Http.BadStatus_ metadata _ ->
Err (Http.BadStatus metadata.statusCode)
Http.GoodStatus_ _ body ->
body
|> decodeBytes decodeResponse
|> Result.mapError Http.BadBody
|> Result.map (\\okResponse -> ( url, okResponse ))
)
, timeout = Nothing
}
|> Task.andThen
(\\( _, response ) ->
case response of
Pages.Internal.ResponseSketch.Redirect location ->
-- TODO what if it redirects to external URL? Need to handle that somehow, or is it an error?
fetchPageData { url | path = location } Nothing
_ ->
Task.succeed ( url, response )
)
byteDecodePageData : Maybe Route -> Bytes.Decode.Decoder PageData
byteDecodePageData route =

View File

@ -80,7 +80,6 @@ type alias ProgramConfig userMsg userModel route pageData sharedData effect mapp
-> List (ApiRoute.ApiRoute ApiRoute.Response)
, pathPatterns : List RoutePattern
, basePath : List String
, fetchPageData : Url -> Maybe { contentType : String, body : String } -> Task Http.Error ( Url, ResponseSketch pageData sharedData )
, sendPageData : Pages.Internal.Platform.ToJsPayload.NewThingForPort -> Cmd Never
, byteEncodePageData : pageData -> Bytes.Encode.Encoder
, byteDecodePageData : route -> Bytes.Decode.Decoder pageData