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
This commit is contained in:
William Carroll 2020-08-02 11:16:24 +01:00
parent d5bc6f963d
commit 699892883c
4 changed files with 105 additions and 45 deletions

View file

@ -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
}