Commit 0557f770 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

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: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 168a5143
......@@ -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());
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment