From 772025e31780d9d96dfe4ce36773df767cb91643 Mon Sep 17 00:00:00 2001 From: "Rene Vergara A." Date: Mon, 3 Jun 2024 14:48:01 -0400 Subject: [PATCH] rvv041 - Code Optimizations getABookRec function commented out from DB.hs abaddresses state renamed to abAddresses --- src/Zenith/DB.hs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Zenith/DB.hs b/src/Zenith/DB.hs index 5cdd5b5..7f98875 100644 --- a/src/Zenith/DB.hs +++ b/src/Zenith/DB.hs @@ -1504,15 +1504,15 @@ updateAdrsInAdrBook pool d a ia = do where_ $ ab ^. AddressBookAbaddress ==. val ia -- | Get one AddrssBook record using the Address as a key -getABookRec :: ConnectionPool -> T.Text -> IO [Entity AddressBook] -getABookRec pool a = do - runNoLoggingT $ - PS.retryOnBusy $ - flip PS.runSqlPool pool $ - select $ do - adrbook <- from $ table @AddressBook - where_ ((adrbook ^. AddressBookAbaddress) ==. val a) - return adrbook +-- getABookRec :: ConnectionPool -> T.Tex t -> IO (Maybe (Entity AddressBook)) +-- getABookRec pool a = do +-- runNoLoggingT $ +-- PS.retryOnBusy $ +-- flip PS.runSqlPool pool $ +-- select $ do +-- adrbook <- from $ table @AddressBook +-- where_ ((adrbook ^. AddressBookAbaddress) ==. val a) +-- return adrbook -- | delete an existing address from AddressBook deleteAdrsFromAB :: ConnectionPool -> T.Text -> IO ()