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-02T10·16+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-08-02T10·16+0100
commit699892883ceaffb64e0d9b9aaab67313a60a5428 (patch)
treec3dd3e40d3a18de274f3b0a4654137ebc3102b75 /client/src/Utils.elm
parentd5bc6f963d4c8cdb8990a9946d9a142a32e13d3c (diff)
Support deleting trips from the client
TL;DR:
- Ensure Types.TripPK in Types.hs uses Calendar.Day for startDate
- Prefer verbiage "GotCreateTrip" to "CreatedTrip"
- Extend Utils.deleteWithCredentials to accept a body parameter
- Support a delete button in the UI
Diffstat (limited to 'client/src/Utils.elm')
-rw-r--r--client/src/Utils.elm5
1 files changed, 3 insertions, 2 deletions
diff --git a/client/src/Utils.elm b/client/src/Utils.elm
index 0f6c61ed286f..28f15fb5c101 100644
--- a/client/src/Utils.elm
+++ b/client/src/Utils.elm
@@ -62,17 +62,18 @@ postWithCredentials { url, body, expect } =
 
 deleteWithCredentials :
     { url : String
+    , body : Http.Body
     , expect : Http.Expect msg
     }
     -> Cmd msg
-deleteWithCredentials { url, expect } =
+deleteWithCredentials { url, body, expect } =
     Http.riskyRequest
         { url = url
         , headers = [ Http.header "Origin" Shared.clientOrigin ]
         , method = "DELETE"
         , timeout = Nothing
         , tracker = Nothing
-        , body = Http.emptyBody
+        , body = body
         , expect = expect
         }