From a3d2d99fef9e1705fbda65bd3a0f6cc9cb4d1b04 Mon Sep 17 00:00:00 2001 From: Decio Ferreira Date: Fri, 28 Feb 2025 23:52:02 +0000 Subject: [PATCH] Refactor HTTP-related functions and update URL endpoints for consistency --- src/Builder/Http.elm | 1 + src/Compiler/Json/Encode.elm | 2 +- src/System/IO.elm | 5 +++++ src/Utils/Main.elm | 4 ++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Builder/Http.elm b/src/Builder/Http.elm index b139db184..44b9666e2 100644 --- a/src/Builder/Http.elm +++ b/src/Builder/Http.elm @@ -191,6 +191,7 @@ getArchive _ url _ _ onSuccess = case response of Http.GoodStatus_ _ body -> let + shaAndArchiveResult : Result Decode.Error ( String, List Zip.Entry ) shaAndArchiveResult = Decode.decodeString (Decode.map2 Tuple.pair diff --git a/src/Compiler/Json/Encode.elm b/src/Compiler/Json/Encode.elm index f79edb0c0..889ab79d4 100644 --- a/src/Compiler/Json/Encode.elm +++ b/src/Compiler/Json/Encode.elm @@ -29,7 +29,7 @@ import Compiler.Data.OneOrMore exposing (OneOrMore(..)) import Data.Map as Dict exposing (Dict) import Data.Set as EverySet exposing (EverySet) import Json.Encode as Encode -import System.IO as IO exposing (IO(..)) +import System.IO as IO exposing (IO) diff --git a/src/System/IO.elm b/src/System/IO.elm index 05a8ec1ed..22d8d5d1b 100644 --- a/src/System/IO.elm +++ b/src/System/IO.elm @@ -79,6 +79,11 @@ module System.IO exposing @docs RealWorldMVar, MVarSubscriber + +# Internal helpers + +@docs writeString + -} import Array exposing (Array) diff --git a/src/Utils/Main.elm b/src/Utils/Main.elm index 1f87c68b1..de30a4283 100644 --- a/src/Utils/Main.elm +++ b/src/Utils/Main.elm @@ -1549,7 +1549,7 @@ binaryEncodeFile encoder path value = (Http.task { method = "POST" , headers = [] - , url = "binaryEncodeFile" + , url = "write" , body = Http.jsonBody (Encode.object @@ -1565,7 +1565,7 @@ binaryEncodeFile encoder path value = Ok (IO.pure ()) _ -> - crash "binaryEncodeFile" + crash "write" ) , timeout = Nothing }