diff options
Diffstat (limited to 'fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs')
| -rw-r--r-- | fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs index b21a976..afd9266 100644 --- a/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs +++ b/fig-monitor-twitch/src/Fig/Monitor/Twitch/Utils.hs @@ -77,9 +77,9 @@ authedRequest method url body = do response <- liftIO $ HTTP.httpLbs request rc.manager pure $ HTTP.responseBody response -authedRequestJSON :: (Aeson.ToJSON a, Aeson.FromJSON b) => Text -> Text -> a -> Authed b +authedRequestJSON :: (Aeson.ToJSON a, Aeson.FromJSON b) => Text -> Text -> Maybe a -> Authed b authedRequestJSON method url val = do - resp <- authedRequest method url $ Aeson.encode val + resp <- authedRequest method url $ maybe "" Aeson.encode val case Aeson.eitherDecode resp of Left err -> do throwM . FigMonitorTwitchException $ tshow err |
