aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-05-11 20:10:22 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-05-31 13:59:45 +0200
commitfb436e8ca0c7468b9698050df0b78447e2d0854f (patch)
tree211d7079a62507576a58a36b578c65fe74c218d7 /src/Wallabag/ApiBundle
parente668a8124c46d47add4248963d77f3b29b37b3ce (diff)
downloadwallabag-fb436e8ca0c7468b9698050df0b78447e2d0854f.tar.gz
wallabag-fb436e8ca0c7468b9698050df0b78447e2d0854f.tar.zst
wallabag-fb436e8ca0c7468b9698050df0b78447e2d0854f.zip
Add support for authors
Diffstat (limited to 'src/Wallabag/ApiBundle')
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index dfd04fb4..e6bbe552 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -284,6 +284,7 @@ class EntryRestController extends WallabagRestController
284 * {"name"="language", "dataType"="string", "required"=false, "description"="Language of the entry"}, 284 * {"name"="language", "dataType"="string", "required"=false, "description"="Language of the entry"},
285 * {"name"="preview_picture", "dataType"="string", "required"=false, "description"="Preview picture of the entry"}, 285 * {"name"="preview_picture", "dataType"="string", "required"=false, "description"="Preview picture of the entry"},
286 * {"name"="published_at", "dataType"="datetime", "format"="YYYY-MM-DDTHH:II:SS+TZ", "required"=false, "description"="Published date of the entry"}, 286 * {"name"="published_at", "dataType"="datetime", "format"="YYYY-MM-DDTHH:II:SS+TZ", "required"=false, "description"="Published date of the entry"},
287 * {"name"="authors", "dataType"="string", "format"="Name Firstname,author2,author3", "required"=false, "description"="Authors of the entry"},
287 * } 288 * }
288 * ) 289 * )
289 * 290 *
@@ -295,12 +296,14 @@ class EntryRestController extends WallabagRestController
295 296
296 $url = $request->request->get('url'); 297 $url = $request->request->get('url');
297 $title = $request->request->get('title'); 298 $title = $request->request->get('title');
299 $tags = $request->request->get('tags', []);
298 $isArchived = $request->request->get('archive'); 300 $isArchived = $request->request->get('archive');
299 $isStarred = $request->request->get('starred'); 301 $isStarred = $request->request->get('starred');
300 $content = $request->request->get('content'); 302 $content = $request->request->get('content');
301 $language = $request->request->get('language'); 303 $language = $request->request->get('language');
302 $picture = $request->request->get('preview_picture'); 304 $picture = $request->request->get('preview_picture');
303 $publishedAt = $request->request->get('published_at'); 305 $publishedAt = $request->request->get('published_at');
306 $authors = $request->request->get('authors', '');
304 307
305 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); 308 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId());
306 309
@@ -322,6 +325,7 @@ class EntryRestController extends WallabagRestController
322 'open_graph' => [ 325 'open_graph' => [
323 'og_image' => $picture, 326 'og_image' => $picture,
324 ], 327 ],
328 'authors' => explode(',', $authors),
325 ] 329 ]
326 ); 330 );
327 } catch (\Exception $e) { 331 } catch (\Exception $e) {
@@ -332,7 +336,7 @@ class EntryRestController extends WallabagRestController
332 $entry->setUrl($url); 336 $entry->setUrl($url);
333 } 337 }
334 338
335 $tags = $request->request->get('tags', []); 339
336 if (!empty($tags)) { 340 if (!empty($tags)) {
337 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags); 341 $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags);
338 } 342 }