aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller')
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 02a6de64..349229f3 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -8,7 +8,6 @@ use Symfony\Component\HttpFoundation\Request;
8use Symfony\Component\HttpFoundation\Response; 8use Symfony\Component\HttpFoundation\Response;
9use Wallabag\CoreBundle\Entity\Entry; 9use Wallabag\CoreBundle\Entity\Entry;
10use Wallabag\CoreBundle\Entity\Tag; 10use Wallabag\CoreBundle\Entity\Tag;
11use Wallabag\CoreBundle\Service\Extractor;
12use Hateoas\Configuration\Route; 11use Hateoas\Configuration\Route;
13use Hateoas\Representation\Factory\PagerfantaFactory; 12use Hateoas\Representation\Factory\PagerfantaFactory;
14 13
@@ -147,11 +146,10 @@ class WallabagRestController extends Controller
147 { 146 {
148 $url = $request->request->get('url'); 147 $url = $request->request->get('url');
149 148
150 $content = Extractor::extract($url); 149 $entry = $this->get('wallabag_core.content_proxy')->updateEntry(
151 $entry = new Entry($this->getUser()); 150 new Entry($this->getUser()),
152 $entry->setUrl($url); 151 $url
153 $entry->setTitle($request->request->get('title') ?: $content->getTitle()); 152 );
154 $entry->setContent($content->getBody());
155 153
156 $tags = $request->request->get('tags', ''); 154 $tags = $request->request->get('tags', '');
157 if (!empty($tags)) { 155 if (!empty($tags)) {