Changes in Persistent
This commit is contained in:
parent
ccb9bba8cd
commit
70a7f52055
@ -20,9 +20,9 @@ class YesodPersist y where
|
|||||||
runDB :: YesodDB y (GGHandler sub y IO) a -> GHandler sub y a
|
runDB :: YesodDB y (GGHandler sub y IO) a -> GHandler sub y a
|
||||||
|
|
||||||
-- | Get the given entity by ID, or return a 404 not found if it doesn't exist.
|
-- | Get the given entity by ID, or return a 404 not found if it doesn't exist.
|
||||||
get404 :: (PersistBackend (t m), PersistEntity val, Monad (t m),
|
get404 :: (PersistBackend t m, PersistEntity val, Monad (t m),
|
||||||
Failure ErrorResponse m, MonadTrans t)
|
Failure ErrorResponse m, MonadTrans t)
|
||||||
=> Key val -> t m val
|
=> Key t val -> t m val
|
||||||
get404 key = do
|
get404 key = do
|
||||||
mres <- get key
|
mres <- get key
|
||||||
case mres of
|
case mres of
|
||||||
@ -31,9 +31,9 @@ get404 key = do
|
|||||||
|
|
||||||
-- | Get the given entity by unique key, or return a 404 not found if it doesn't
|
-- | Get the given entity by unique key, or return a 404 not found if it doesn't
|
||||||
-- exist.
|
-- exist.
|
||||||
getBy404 :: (PersistBackend (t m), PersistEntity val, Monad (t m),
|
getBy404 :: (PersistBackend t m, PersistEntity val, Monad (t m),
|
||||||
Failure ErrorResponse m, MonadTrans t)
|
Failure ErrorResponse m, MonadTrans t)
|
||||||
=> Unique val -> t m (Key val, val)
|
=> Unique val t -> t m (Key t val, val)
|
||||||
getBy404 key = do
|
getBy404 key = do
|
||||||
mres <- getBy key
|
mres <- getBy key
|
||||||
case mres of
|
case mres of
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user