aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-11 20:17:42 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-09-11 20:17:42 +0200
commit9c08a891f9bb90bc3f23a575a734283c1ee00ba1 (patch)
treef5e90765bdd2b923cbd008722e12be25028bdf6d /src/Wallabag/ApiBundle/Controller/WallabagRestController.php
parent49e564ec159371d9fa751ba75f9f1c555d108179 (diff)
parentf1e29e69cb0ba5a0f05190c62e7a4afd43d03436 (diff)
downloadwallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.tar.gz
wallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.tar.zst
wallabag-9c08a891f9bb90bc3f23a575a734283c1ee00ba1.zip
Merge pull request #1397 from wallabag/v2-graby
Integrate graby
Diffstat (limited to 'src/Wallabag/ApiBundle/Controller/WallabagRestController.php')
-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)) {