X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FApiBundle%2FController%2FWallabagRestController.php;h=b786d4ca2fbfcf2d000402e26d0a195e304eaa50;hb=873e3806585078222b31e0d24d0c6159c493727f;hp=da671a61469a910020dce34811c603b4432cb9f2;hpb=f642863ff258972df90940a59510d14b6f366883;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index da671a61..b786d4ca 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -109,8 +109,9 @@ class WallabagRestController extends FOSRestController $this->validateAuthentication(); $url = $request->request->get('url'); - $isArchived = (int) $request->request->get('archive'); - $isStarred = (int) $request->request->get('starred'); + $title = $request->request->get('title'); + $isArchived = $request->request->get('archive'); + $isStarred = $request->request->get('starred'); $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($url, $this->getUser()->getId()); @@ -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']); } }