diff options
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 06520af9..aff0534a 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -103,6 +103,7 @@ class EntryRestController extends WallabagRestController | |||
103 | * {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, | 103 | * {"name"="tags", "dataType"="string", "required"=false, "format"="api,rest", "description"="a list of tags url encoded. Will returns entries that matches ALL tags."}, |
104 | * {"name"="since", "dataType"="integer", "required"=false, "format"="default '0'", "description"="The timestamp since when you want entries updated."}, | 104 | * {"name"="since", "dataType"="integer", "required"=false, "format"="default '0'", "description"="The timestamp since when you want entries updated."}, |
105 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by entries with a public link"}, | 105 | * {"name"="public", "dataType"="integer", "required"=false, "format"="1 or 0, all entries by default", "description"="filter by entries with a public link"}, |
106 | * {"name"="detail", "dataType"="string", "required"=false, "format"="metadata or full, metadata by default", "description"="include content field if 'full'. 'full' by default for backward compatibility."}, | ||
106 | * } | 107 | * } |
107 | * ) | 108 | * ) |
108 | * | 109 | * |
@@ -121,6 +122,7 @@ class EntryRestController extends WallabagRestController | |||
121 | $perPage = (int) $request->query->get('perPage', 30); | 122 | $perPage = (int) $request->query->get('perPage', 30); |
122 | $tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); | 123 | $tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); |
123 | $since = $request->query->get('since', 0); | 124 | $since = $request->query->get('since', 0); |
125 | $detail = strtolower($request->query->get('detail', 'full')); | ||
124 | 126 | ||
125 | try { | 127 | try { |
126 | /** @var \Pagerfanta\Pagerfanta $pager */ | 128 | /** @var \Pagerfanta\Pagerfanta $pager */ |
@@ -132,7 +134,8 @@ class EntryRestController extends WallabagRestController | |||
132 | $sort, | 134 | $sort, |
133 | $order, | 135 | $order, |
134 | $since, | 136 | $since, |
135 | $tags | 137 | $tags, |
138 | $detail | ||
136 | ); | 139 | ); |
137 | } catch (\Exception $e) { | 140 | } catch (\Exception $e) { |
138 | throw new BadRequestHttpException($e->getMessage()); | 141 | throw new BadRequestHttpException($e->getMessage()); |
@@ -156,6 +159,7 @@ class EntryRestController extends WallabagRestController | |||
156 | 'perPage' => $perPage, | 159 | 'perPage' => $perPage, |
157 | 'tags' => $tags, | 160 | 'tags' => $tags, |
158 | 'since' => $since, | 161 | 'since' => $since, |
162 | 'detail' => $detail, | ||
159 | ], | 163 | ], |
160 | true | 164 | true |
161 | ) | 165 | ) |