diff --git a/src/API.hs b/src/API.hs index f858e6d7a..ef185e246 100644 --- a/src/API.hs +++ b/src/API.hs @@ -17,4 +17,4 @@ type API = "user" :> Get '[JSON] (Maybe T.Account) :<|> "trip" :> ReqBody '[JSON] T.Trip - :> Post '[JSON] Bool + :> Post '[JSON] NoContent diff --git a/src/App.hs b/src/App.hs index 20d99e385..d244c9b56 100644 --- a/src/App.hs +++ b/src/App.hs @@ -42,11 +42,11 @@ server dbFile = userAddH [x] -> pure (Just x) _ -> pure Nothing - createTrip :: T.Trip -> IO Bool + createTrip :: T.Trip -> IO NoContent createTrip trip = withConnection dbFile $ \conn -> do execute conn "INSERT INTO Trips (username,destination,startDate,endDate,comment) VALUES (?,?,?,?,?)" (trip & T.tripFields) - pure True + pure NoContent mkApp :: FilePath -> IO Application mkApp dbFile = do