From fa64226855f63bafad9cf0a59baef200030eabed Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Thu, 27 Nov 2025 10:04:35 -0500 Subject: 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 --- Omni/Agent/Worker.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Omni/Agent/Worker.hs') 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 () -- cgit v1.2.3