]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/WallabagRestController.php
Set the title via POST /api/entries
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / WallabagRestController.php
index da671a61469a910020dce34811c603b4432cb9f2..5202c524c68da16c0b2f0411e76ebbeeff1a7268 100644 (file)
@@ -109,6 +109,7 @@ class WallabagRestController extends FOSRestController
         $this->validateAuthentication();
 
         $url = $request->request->get('url');
+        $title = $request->request->get('title');
         $isArchived = (int) $request->request->get('archive');
         $isStarred = (int) $request->request->get('starred');
 
@@ -121,6 +122,10 @@ class WallabagRestController extends FOSRestController
             );
         }
 
+        if (!is_null($title)) {
+            $entry->setTitle($title);
+        }
+
         $tags = $request->request->get('tags', '');
         if (!empty($tags)) {
             $this->get('wallabag_core.content_proxy')->assignTagsToEntry($entry, $tags);
@@ -384,6 +389,6 @@ class WallabagRestController extends FOSRestController
      */
     private function renderJsonResponse($json)
     {
-        return new Response($json, 200, array('application/json'));
+        return new Response($json, 200, ['application/json']);
     }
 }