Fix API count decoding
This commit is contained in:
parent
5c13de1b8f
commit
5101eb5c73
3 changed files with 35 additions and 6 deletions
|
|
@ -12,7 +12,7 @@ validateWidgetType ::
|
|||
Text -> IO (Either Text ())
|
||||
validateWidgetType name = do
|
||||
rows <- sqlQuery
|
||||
"SELECT COUNT(*) FROM widget_type_registry WHERE name = ? AND status = 'active'"
|
||||
"SELECT COUNT(*)::int FROM widget_type_registry WHERE name = ? AND status = 'active'"
|
||||
(Only name)
|
||||
case rows of
|
||||
[Only (n :: Int)] | n > 0 -> pure (Right ())
|
||||
|
|
@ -24,7 +24,7 @@ validateEventType ::
|
|||
Text -> IO (Either Text ())
|
||||
validateEventType name = do
|
||||
rows <- sqlQuery
|
||||
"SELECT COUNT(*) FROM event_type_registry WHERE name = ? AND status = 'active'"
|
||||
"SELECT COUNT(*)::int FROM event_type_registry WHERE name = ? AND status = 'active'"
|
||||
(Only name)
|
||||
case rows of
|
||||
[Only (n :: Int)] | n > 0 -> pure (Right ())
|
||||
|
|
@ -36,7 +36,7 @@ validateAnnotationCategory ::
|
|||
Text -> IO (Either Text ())
|
||||
validateAnnotationCategory name = do
|
||||
rows <- sqlQuery
|
||||
"SELECT COUNT(*) FROM annotation_category_registry WHERE name = ? AND status = 'active'"
|
||||
"SELECT COUNT(*)::int FROM annotation_category_registry WHERE name = ? AND status = 'active'"
|
||||
(Only name)
|
||||
case rows of
|
||||
[Only (n :: Int)] | n > 0 -> pure (Right ())
|
||||
|
|
@ -48,7 +48,7 @@ validatePolicyScope ::
|
|||
Text -> IO (Either Text ())
|
||||
validatePolicyScope name = do
|
||||
rows <- sqlQuery
|
||||
"SELECT COUNT(*) FROM policy_scope_registry WHERE name = ? AND status = 'active'"
|
||||
"SELECT COUNT(*)::int FROM policy_scope_registry WHERE name = ? AND status = 'active'"
|
||||
(Only name)
|
||||
case rows of
|
||||
[Only (n :: Int)] | n > 0 -> pure (Right ())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue