From ff02141235d1dbec3492c5a7b49631fe440c4806 Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sat, 3 Jan 2026 21:59:46 -0500 Subject: web: Add Shindigs sorting endpoints --- fig-web/src/Fig/Web/Utils.hs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fig-web/src/Fig/Web/Utils.hs') 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) -- cgit v1.2.3