rvv041 - CRUD operations for AddressBook completed
delete record using AddressBookId
This commit is contained in:
parent
e9e56453c1
commit
83cc1905ad
1 changed files with 10 additions and 0 deletions
|
@ -1503,5 +1503,15 @@ updateAdrsInAdrBook pool a i = do
|
|||
set ab [AddressBookAddress =. val a]
|
||||
where_ $ ab ^. AddressBookId ==. val i
|
||||
|
||||
-- | delete an existing address from AddressBook
|
||||
deleteAdrsFromAB :: ConnectionPool -> AddressBookId -> IO ()
|
||||
deleteAdrsFromAB pool i = do
|
||||
runNoLoggingT $
|
||||
PS.retryOnBusy $
|
||||
flip PS.runSqlPool pool $ do
|
||||
delete $ do
|
||||
ab <- from $ table @AddressBook
|
||||
where_ (ab ^. AddressBookId ==. val i)
|
||||
|
||||
rmdups :: Ord a => [a] -> [a]
|
||||
rmdups = map head . group . sort
|
||||
|
|
Loading…
Reference in a new issue