From caa98b19119cf393cbc6a4aba1b46812c893cdec Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sun, 3 May 2026 14:47:45 -0400 Subject: Add endpoint to query all users --- fig-web/src/Fig/Web/Module/User.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fig-web/src') diff --git a/fig-web/src/Fig/Web/Module/User.hs b/fig-web/src/Fig/Web/Module/User.hs index 550130c..5d473ff 100644 --- a/fig-web/src/Fig/Web/Module/User.hs +++ b/fig-web/src/Fig/Web/Module/User.hs @@ -128,6 +128,11 @@ public a = do respondText "username not found" Just val -> respondText val -- users + onGet "/api/users" do + let pfx = "user:stats:" + users <- DB.run a.db . DB.keys . encodeUtf8 $ pfx <> "*" + let strip x = fromMaybe x $ Text.stripPrefix pfx x + respondText . Text.unlines $ strip . decodeUtf8 <$> users onGet "/api/user/info/:uid" do -- get everything bundled together uid <- pathParam "uid" info <- getUserInfo a.db uid -- cgit v1.2.3