@@ -13,7 +13,6 @@
1313
1414module Network.PagerDuty.REST
1515 (
16−
1716 -- * Sending requests
1817 send
1918 , sendWith
@@ -56,7 +55,7 @@ sendWith :: (MonadIO m, FromJSON b)
5655 => Env s
5756 -> Request a s b
5857 -> m (Either Error b)
59−sendWith e = liftM (fmap fst) . http e
58+sendWith e = liftM (fmap _pgItem) . http e
6059
6160-- | /See:/ 'paginateWith'
6261paginate :: (MonadIO m, Paginate a, FromJSON b)
@@ -75,15 +74,15 @@ paginateWith e = go
7574 where
7675 go rq = do
7776 rs <- lift (http e rq)
78− yield (fst <$> rs)
77+ yield (_pgItem <$> rs)
7978 either (const (return ()))
80− (maybe (return ()) go . next rq . snd)
79+ (maybe (return ()) go . next rq . _pgPager)
8180 rs
8281
8382http :: (MonadIO m, FromJSON b)
8483 => Env s
8584 -> Request a s b
86− -> m (Either Error (b, Maybe Pager))
85+ -> m (Either Error (Page b))
8786http e rq = request (e ^. envManager) (e ^. envLogger) rq $ raw
8887 { Client.host = domain (e ^. envDomain)
8988 , Client.path = renderPath (rq ^. path)