include YesodPersist in get404 type signature
This commit is contained in:
parent
dfcbe249e4
commit
66af962af8
@ -122,19 +122,19 @@ respondSourceDB :: YesodPersistRunner site
|
|||||||
-> HandlerT site IO TypedContent
|
-> HandlerT site IO TypedContent
|
||||||
respondSourceDB ctype = respondSource ctype . runDBSource
|
respondSourceDB ctype = respondSource ctype . runDBSource
|
||||||
|
|
||||||
|
|
||||||
-- | 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 :: ( PersistStore (t m)
|
get404 :: ( PersistEntity record
|
||||||
, PersistEntity val
|
|
||||||
, Monad (t m)
|
|
||||||
, m ~ HandlerT site IO
|
, m ~ HandlerT site IO
|
||||||
, MonadTrans t
|
, db ~ YesodPersistBackend site
|
||||||
, PersistMonadBackend (t m) ~ PersistEntityBackend val
|
, PersistStore (db m)
|
||||||
)
|
, YesodPersist site
|
||||||
=> Key val -> t m val
|
, PersistMonadBackend (db m) ~ PersistEntityBackend record
|
||||||
|
) => Key record -> HandlerT site IO record
|
||||||
get404 key = do
|
get404 key = do
|
||||||
mres <- get key
|
mres <- runDB $ get key
|
||||||
case mres of
|
case mres of
|
||||||
Nothing -> notFound'
|
Nothing -> notFound
|
||||||
Just res -> return res
|
Just res -> return res
|
||||||
|
|
||||||
-- | 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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user