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

@ -237,10 +237,10 @@ instance FromRow Trip where
data TripPK = TripPK
{ tripPKUsername :: Username
, tripPKDestination :: Destination
, tripPKStartDate :: Clock.UTCTime
, tripPKStartDate :: Calendar.Day
} deriving (Eq, Show, Generic)
tripPKFields :: TripPK -> (Username, Destination, Clock.UTCTime)
tripPKFields :: TripPK -> (Username, Destination, Calendar.Day)
tripPKFields (TripPK{..})
= (tripPKUsername, tripPKDestination, tripPKStartDate)