diff options
| author | LLLL Colonq <llll@colonq> | 2026-01-03 21:59:46 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-01-03 21:59:46 -0500 |
| commit | ff02141235d1dbec3492c5a7b49631fe440c4806 (patch) | |
| tree | 96fb1e2dd08d6b97ddf251e971c5845957692ce9 /fig-web/src/Fig/Web/Utils.hs | |
| parent | be79bc5f0a1435a8ba34b163218a44b93cca503d (diff) | |
web: Add Shindigs sorting endpoints
Diffstat (limited to 'fig-web/src/Fig/Web/Utils.hs')
| -rw-r--r-- | fig-web/src/Fig/Web/Utils.hs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fig-web/src/Fig/Web/Utils.hs b/fig-web/src/Fig/Web/Utils.hs index 59781cd..db449ee 100644 --- a/fig-web/src/Fig/Web/Utils.hs +++ b/fig-web/src/Fig/Web/Utils.hs @@ -9,6 +9,7 @@ module Fig.Web.Utils , module Network.HTTP.Types.Status , onGet, onPost, onPut, onDelete , status + , body, bodyJSON , queryParam, queryParamMaybe, formParam, formParamMaybe, pathParam , header, addHeader , respondBytes, respondText, respondJSON, respondHTMLText, respondHTML, redirect @@ -129,6 +130,12 @@ onDelete = Sc.delete status :: Status -> Sc.ActionM () status = Sc.status +body :: Sc.ActionM ByteString +body = BS.L.toStrict <$> Sc.body + +bodyJSON :: Aeson.FromJSON a => Sc.ActionM a +bodyJSON = Sc.jsonData + queryParam :: Sc.Parsable a => Text -> Sc.ActionM a queryParam = Sc.queryParam . Text.L.fromStrict queryParamMaybe :: Sc.Parsable a => Text -> Sc.ActionM (Maybe a) |
