From 66666390b3c553bdeebb0bcf8a6ddc7fd1e1d72b Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 20 Apr 2024 14:00:46 -0400 Subject: chore: don't use deprecated param and liftAndCatchIO functions --- src/RestService.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/RestService.hs') diff --git a/src/RestService.hs b/src/RestService.hs index 6d92e69..3bad9b6 100755 --- a/src/RestService.hs +++ b/src/RestService.hs @@ -75,21 +75,21 @@ routes state = do get "/t/dummy" $ S.json $ evalTableExpressions (TableExpressions dummyTable ["sum(2,3,5)", "any(0,0,1)", "sum(age, -10)", "any(0,1)"]) get "/t/:id" $ - S.json =<< liftAndCatchIO . getTable state =<< S.param "id" + S.json =<< liftIO . getTable state =<< S.pathParam "id" get "/t/:id/e/:e" $ do - id <- S.param "id" - ex <- S.param "e" + id <- S.pathParam "id" + ex <- S.pathParam "e" S.json . fmap (evalTableExpressions . flip TableExpressions [ex]) - =<< liftAndCatchIO (getTable state id) + =<< liftIO (getTable state id) post "/t/:id" $ do - id <- S.param "id" - S.json =<< liftAndCatchIO . setTable state id =<< S.jsonData + id <- S.pathParam "id" + S.json =<< liftIO . setTable state id =<< S.jsonData post "/t/:id/row" $ do - id <- S.param "id" - S.json =<< liftAndCatchIO . insertRow state id =<< S.jsonData + id <- S.pathParam "id" + S.json =<< liftIO . insertRow state id =<< S.jsonData get "/:expr" $ - S.text =<< S.param "expr" + S.text =<< S.pathParam "expr" post "/eval" $ S.json . (ExprReq <*> eval M.empty) . expression =<< S.jsonData -- cgit v1.2.3