Fix constraints on get404 and getBy404
The constraints on `get404` and `getBy404` were overly powerful. They were constrained by `PersistStore` and `PersistStoreUnique`, which is an alias for `PersistStoreWrite...`. These only need `PersistStoreRead...` to accomplish their job.
This commit is contained in:
parent
d848a7123f
commit
33d3200399
@ -134,7 +134,7 @@ 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.
|
||||||
#if MIN_VERSION_persistent(2,5,0)
|
#if MIN_VERSION_persistent(2,5,0)
|
||||||
get404 :: (MonadIO m, PersistStore backend, PersistRecordBackend val backend)
|
get404 :: (MonadIO m, PersistStoreRead backend, PersistRecordBackend val backend)
|
||||||
=> Key val
|
=> Key val
|
||||||
-> ReaderT backend m val
|
-> ReaderT backend m val
|
||||||
#else
|
#else
|
||||||
@ -151,7 +151,7 @@ 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.
|
||||||
#if MIN_VERSION_persistent(2,5,0)
|
#if MIN_VERSION_persistent(2,5,0)
|
||||||
getBy404 :: (PersistUnique backend, PersistRecordBackend val backend, MonadIO m)
|
getBy404 :: (PersistUniqueRead backend, PersistRecordBackend val backend, MonadIO m)
|
||||||
=> Unique val
|
=> Unique val
|
||||||
-> ReaderT backend m (Entity val)
|
-> ReaderT backend m (Entity val)
|
||||||
#else
|
#else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user