REST API - getLinks: support the visibility parameter

This commit is contained in:
ArthurHoaro 2017-01-17 18:51:40 +01:00
parent 89dcbe5277
commit c37a6f820b
2 changed files with 24 additions and 31 deletions
application/api/controllers

View file

@ -34,15 +34,14 @@ class Links extends ApiController
*/
public function getLinks($request, $response)
{
$private = $request->getParam('private');
$private = $request->getParam('visibility');
$links = $this->linkDb->filterSearch(
[
'searchtags' => $request->getParam('searchtags', ''),
'searchterm' => $request->getParam('searchterm', ''),
],
false,
// to updated in another PR depending on the API doc
($private === 'true' || $private === '1') ? 'private' : 'all'
$private
);
// Return links from the {offset}th link, starting from 0.