aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index 55906ce0..abbf5437 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -80,17 +80,14 @@ class WallabagRestController extends Controller
80 */ 80 */
81 public function postEntriesAction(Request $request) 81 public function postEntriesAction(Request $request)
82 { 82 {
83 //TODO la récup ne marche pas
84 //TODO gérer si on passe le titre
85 //TODO gérer si on passe les tags 83 //TODO gérer si on passe les tags
86 //TODO ne pas avoir du code comme ça qui doit se trouver dans le Repository
87 $url = $request->request->get('url'); 84 $url = $request->request->get('url');
88 85
89 $content = Extractor::extract($url); 86 $content = Extractor::extract($url);
90 $entry = new Entries(); 87 $entry = new Entries();
91 $entry->setUserId(1); 88 $entry->setUserId(1);
92 $entry->setUrl($url); 89 $entry->setUrl($url);
93 $entry->setTitle($content->getTitle()); 90 $entry->setTitle($request->request->get('title') ?: $content->getTitle());
94 $entry->setContent($content->getBody()); 91 $entry->setContent($content->getBody());
95 $em = $this->getDoctrine()->getManager(); 92 $em = $this->getDoctrine()->getManager();
96 $em->persist($entry); 93 $em->persist($entry);