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>
This commit is contained in:
Lukas Fleischer 2011-11-03 08:48:20 +01:00
parent 168a51431b
commit 0557f7705a

View file

@ -152,7 +152,7 @@ class AurJSON {
return $this->json_results($type, $resultcount, $search_data); return $this->json_results($type, $resultcount, $search_data);
} }
else { else {
return $this->json_error('No results found'); return $this->json_results($type, 0, array());
} }
} }