aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/api/controllers/Links.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2017-01-17 18:51:40 +0100
committerArthurHoaro <arthur@hoa.ro>2017-01-17 18:53:18 +0100
commitc37a6f820b0a213ee2d5980a96aafac262aeb97a (patch)
tree61d9c4995198a173dff3cde8787e4acf76b419c3 /application/api/controllers/Links.php
parent89dcbe52775bac8d544448ff4f80b6256875de91 (diff)
downloadShaarli-c37a6f820b0a213ee2d5980a96aafac262aeb97a.tar.gz
Shaarli-c37a6f820b0a213ee2d5980a96aafac262aeb97a.tar.zst
Shaarli-c37a6f820b0a213ee2d5980a96aafac262aeb97a.zip
REST API - getLinks: support the visibility parameter
Diffstat (limited to 'application/api/controllers/Links.php')
-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.