add: chunk conten_provider for file download
This commit is contained in:
@@ -3,7 +3,7 @@ module Globals exposing (..)
|
||||
|
||||
api : String
|
||||
api =
|
||||
"http://127.0.0.1/api/"
|
||||
"/api/"
|
||||
|
||||
|
||||
apiEndpoint : String -> String
|
||||
@@ -14,6 +14,9 @@ apiEndpoint path =
|
||||
apiStatus : String -> String
|
||||
apiStatus id = String.concat [apiEndpoint "status/", id]
|
||||
|
||||
apiAdd : String
|
||||
apiAdd = apiEndpoint "add"
|
||||
|
||||
apiDownloadFile : String -> String
|
||||
apiDownloadFile id = String.concat [apiEndpoint "file/", id]
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import Json.Decode exposing (Decoder, int, string, succeed)
|
||||
import Json.Decode.Pipeline exposing (required)
|
||||
import Json.Encode as Encode
|
||||
import Html.Events exposing (onMouseOver)
|
||||
|
||||
import Globals exposing(apiAdd)
|
||||
|
||||
type alias Form =
|
||||
{ url : String
|
||||
@@ -179,7 +179,7 @@ update navKey msg model =
|
||||
if not (String.isEmpty form.url) then
|
||||
( model
|
||||
, Http.post
|
||||
{ url = "http://127.0.0.1/api/add"
|
||||
{ url = apiAdd
|
||||
, body = Http.jsonBody (formPostEncoder form)
|
||||
, expect = Http.expectJson PostResult formDecoder
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user