diff options
| author | LLLL Colonq <llll@colonq> | 2026-05-03 14:47:45 -0400 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-05-03 14:47:45 -0400 |
| commit | caa98b19119cf393cbc6a4aba1b46812c893cdec (patch) | |
| tree | 47c5e6229d4b4887ae02b8c9c0d8874cb8084265 /fig-web/src/Fig | |
| parent | 91cf14c9dabecf5e07b310c5d12ad702d570b14f (diff) | |
Add endpoint to query all users
Diffstat (limited to 'fig-web/src/Fig')
| -rw-r--r-- | fig-web/src/Fig/Web/Module/User.hs | 5 |
1 files changed, 5 insertions, 0 deletions
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 |
