aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/controllers
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-02-13 08:41:12 +0100
committerGitHub <noreply@github.com>2017-02-13 08:41:12 +0100
commit65e56cbe49a7eb2a0cb09dda85daab3b921472ee (patch)
tree3e1d42f51fc179d06cfe50531a755fd37df41468 /application/api/controllers
parent5f3f19f1c0f1a4feac20c40fe9ee8437469450f3 (diff)
parentc37a6f820b0a213ee2d5980a96aafac262aeb97a (diff)
downloadShaarli-65e56cbe49a7eb2a0cb09dda85daab3b921472ee.tar.gz
Shaarli-65e56cbe49a7eb2a0cb09dda85daab3b921472ee.tar.zst
Shaarli-65e56cbe49a7eb2a0cb09dda85daab3b921472ee.zip
Merge pull request #769 from ArthurHoaro/api/getlinks-visibility
REST API - getLinks: support the visibility parameter
Diffstat (limited to 'application/api/controllers')
-rw-r--r--application/api/controllers/Links.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/application/api/controllers/Links.php b/application/api/controllers/Links.php
index 01b7e783..0a7968e3 100644
--- a/application/api/controllers/Links.php
+++ b/application/api/controllers/Links.php
@@ -34,15 +34,14 @@ class Links extends ApiController
34 */ 34 */
35 public function getLinks($request, $response) 35 public function getLinks($request, $response)
36 { 36 {
37 $private = $request->getParam('private'); 37 $private = $request->getParam('visibility');
38 $links = $this->linkDb->filterSearch( 38 $links = $this->linkDb->filterSearch(
39 [ 39 [
40 'searchtags' => $request->getParam('searchtags', ''), 40 'searchtags' => $request->getParam('searchtags', ''),
41 'searchterm' => $request->getParam('searchterm', ''), 41 'searchterm' => $request->getParam('searchterm', ''),
42 ], 42 ],
43 false, 43 false,
44 // to updated in another PR depending on the API doc 44 $private
45 ($private === 'true' || $private === '1') ? 'private' : 'all'
46 ); 45 );
47 46
48 // Return links from the {offset}th link, starting from 0. 47 // Return links from the {offset}th link, starting from 0.