[aur-dev] [PATCH] RPC: Do not return an error on 0 results
Return an empty array and set the result count to zero instead. Before: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"error","resultcount":0,"results":"No results found"} After: $ curl 'http://localhost/rpc.php?type=search&arg=raboof' {"type":"search","resultcount":0,"results":[]} Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de> --- web/lib/aurjson.class.php | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 4b97d2b..c1b079a 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -152,7 +152,7 @@ class AurJSON { return $this->json_results($type, $resultcount, $search_data); } else { - return $this->json_error('No results found'); + return $this->json_results($type, 0, array()); } } -- 1.7.7.2
participants (1)
-
Lukas Fleischer