Fix empty results
This commit is contained in:
+2
-2
@@ -62,7 +62,7 @@ app conn req respond =
|
|||||||
)
|
)
|
||||||
row <- listToMaybe <$> uncurry (query conn) select
|
row <- listToMaybe <$> uncurry (query conn) select
|
||||||
let (tableTotal, queryTotal, body) =
|
let (tableTotal, queryTotal, body) =
|
||||||
fromMaybe (0, 0, "" :: ByteString) row
|
fromMaybe (0, 0, Just "" :: Maybe ByteString) row
|
||||||
from = fromMaybe 0 $ rangeOffset <$> range
|
from = fromMaybe 0 $ rangeOffset <$> range
|
||||||
to = from+queryTotal
|
to = from+queryTotal
|
||||||
contentRange = contentRangeH from to tableTotal
|
contentRange = contentRangeH from to tableTotal
|
||||||
@@ -78,7 +78,7 @@ app conn req respond =
|
|||||||
"/" <> cs table <>
|
"/" <> cs table <>
|
||||||
if Prelude.null canonical then "" else "?" <> cs canonical
|
if Prelude.null canonical then "" else "?" <> cs canonical
|
||||||
)
|
)
|
||||||
] (cs body)
|
] (cs $ fromMaybe "[]" body)
|
||||||
|
|
||||||
(["dbapi", "users"], "POST") -> do
|
(["dbapi", "users"], "POST") -> do
|
||||||
body <- strictRequestBody req
|
body <- strictRequestBody req
|
||||||
|
|||||||
Reference in New Issue
Block a user