about summary refs log tree commit diff
path: root/client/src/Utils.elm
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-08-02T19·56+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-02T19·56+0100
commitc2419cd9127c0077561c6f2c4c801998d231cc41 (patch)
tree3715b5e8db3615389af36821e062933f355ecbe1 /client/src/Utils.elm
parent239ff24c95458fdff0706b99b8dab9d2fc8c8386 (diff)
Support updating trips from the client
Edit existing trips.
Diffstat (limited to 'client/src/Utils.elm')
-rw-r--r--client/src/Utils.elm18
1 files changed, 18 insertions, 0 deletions
diff --git a/client/src/Utils.elm b/client/src/Utils.elm
index 28f15fb5c1..60343cd870 100644
--- a/client/src/Utils.elm
+++ b/client/src/Utils.elm
@@ -77,6 +77,24 @@ deleteWithCredentials { url, body, expect } =
         , expect = expect
         }
 
+putWithCredentials :
+    { url : String
+    , body : Http.Body
+    , expect : Http.Expect msg
+    }
+    -> Cmd msg
+putWithCredentials { url, body, expect } =
+    Http.riskyRequest
+        { url = url
+        , headers = [ Http.header "Origin" Shared.clientOrigin ]
+        , method = "PUT"
+        , timeout = Nothing
+        , tracker = Nothing
+        , body = body
+        , expect = expect
+        }
+
+
 
 formatTime : Time.Posix -> String
 formatTime ts =