From c2419cd9127c0077561c6f2c4c801998d231cc41 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sun, 2 Aug 2020 20:56:29 +0100 Subject: Support updating trips from the client Edit existing trips. --- client/src/Utils.elm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'client/src/Utils.elm') diff --git a/client/src/Utils.elm b/client/src/Utils.elm index 28f15fb5c101..60343cd87018 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 = -- cgit 1.4.1