summaryrefslogtreecommitdiff
path: root/Omni/Task
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Task')
-rw-r--r--Omni/Task/Core.hs18
1 files changed, 7 insertions, 11 deletions
diff --git a/Omni/Task/Core.hs b/Omni/Task/Core.hs
index bd70fde..4e65581 100644
--- a/Omni/Task/Core.hs
+++ b/Omni/Task/Core.hs
@@ -140,18 +140,14 @@ instance FromJSON TaskActivity
-- HTTP API Instances (for Servant query params)
instance FromHttpApiData Status where
- parseQueryParam t
- | T.null t = Left ""
- | otherwise = case readMaybe (T.unpack t) of
- Just s -> Right s
- Nothing -> Left ("Invalid status: " <> t)
+ parseQueryParam t = case readMaybe (T.unpack t) of
+ Just s -> Right s
+ Nothing -> Left ("Invalid status: " <> t)
instance FromHttpApiData Priority where
- parseQueryParam t
- | T.null t = Left ""
- | otherwise = case readMaybe (T.unpack t) of
- Just p -> Right p
- Nothing -> Left ("Invalid priority: " <> t)
+ parseQueryParam t = case readMaybe (T.unpack t) of
+ Just p -> Right p
+ Nothing -> Left ("Invalid priority: " <> t)
-- SQLite Instances
@@ -1013,7 +1009,7 @@ logActivity tid stage metadata =
SQL.execute
conn
"INSERT INTO task_activity (task_id, stage, message, metadata) VALUES (?, ?, ?, ?)"
- (tid, show stage, Nothing :: Maybe Text, metadata)
+ (tid, show stage :: String, Nothing :: Maybe Text, metadata)
-- | Get all activities for a task, ordered by timestamp descending
getActivitiesForTask :: Text -> IO [TaskActivity]