diff options
| author | Ben Sima <ben@bensima.com> | 2025-11-27 10:04:35 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-11-27 10:04:35 -0500 |
| commit | fa64226855f63bafad9cf0a59baef200030eabed (patch) | |
| tree | 955796125f718c2ab2182068dc226f5fbd60e901 /Omni/Agent/Worker.hs | |
| parent | dbe2b82d2f53761d9504fb4e5cf37f64a2000b7a (diff) | |
Fix filter dropdowns returning empty string for All option
The build passes. The fix I implemented:
1. **Changed the API type** in `Omni/Jr/Web.hs` to use `QueryParam
"stat 2. **Added manual parsing** in `taskListHandler` with
`parseStatus` and 3. **Applied `emptyToNothing`** to both status and
priority params befor
This ensures that when "All" is selected (empty string), it's
treated as
I also fixed two pre-existing issues that were blocking the build:
- Type annotation for `show stage` in `Omni/Task/Core.hs` -
`AesonKey.fromText` conversion in `Omni/Agent/Worker.hs`
Task-Id: t-149.1
Diffstat (limited to 'Omni/Agent/Worker.hs')
| -rw-r--r-- | Omni/Agent/Worker.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs index 2c603a9..2557d70 100644 --- a/Omni/Agent/Worker.hs +++ b/Omni/Agent/Worker.hs @@ -5,6 +5,7 @@ module Omni.Agent.Worker where import Alpha import qualified Data.Aeson as Aeson +import qualified Data.Aeson.Key as AesonKey import qualified Data.ByteString.Lazy as BSL import qualified Data.Text as Text import qualified Data.Text.Encoding as TE @@ -40,7 +41,7 @@ logMsg worker msg = -- | Convert key-value pairs to JSON metadata string toMetadata :: [(Text, Text)] -> Text toMetadata pairs = - let obj = Aeson.object [(k, Aeson.String v) | (k, v) <- pairs] + let obj = Aeson.object [(AesonKey.fromText k, Aeson.String v) | (k, v) <- pairs] in TE.decodeUtf8 (BSL.toStrict (Aeson.encode obj)) runOnce :: Core.Worker -> Maybe Text -> IO () |
