Support GET /trips
In the spirit of support CRUDL, I added a GET /trips, which lists all of the trips in the Trips table.
This commit is contained in:
parent
2f73d1db6c
commit
0637da36cc
3 changed files with 15 additions and 0 deletions
|
|
@ -192,6 +192,13 @@ data Trip = Trip
|
|||
, tripComment :: Comment
|
||||
} deriving (Eq, Show, Generic)
|
||||
|
||||
instance FromRow Trip where
|
||||
fromRow = Trip <$> field
|
||||
<*> field
|
||||
<*> field
|
||||
<*> field
|
||||
<*> field
|
||||
|
||||
-- | Return the tuple representation of a Trip record for SQL.
|
||||
tripFields :: Trip -> (Username, Destination, Date, Date, Comment)
|
||||
tripFields (Trip{ tripUsername
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue