X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FWallabagRestController.php;h=f14f821b153b322f301c74ff2cd0293d4f271f7c;hb=c8dee953961964aa842e516995f0c6fafd007f9b;hp=fae633fa4b58725cbe7a027d33e958ca8ba9fe58;hpb=c0284f6182a7421d2352e9288205d70b81185a7d;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index fae633fa..f14f821b 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -80,17 +80,14 @@ class WallabagRestController extends Controller */ public function postEntriesAction(Request $request) { - //TODO la récup ne marche pas - //TODO gérer si on passe le titre //TODO gérer si on passe les tags - //TODO ne pas avoir du code comme ça qui doit se trouver dans le Repository $url = $request->request->get('url'); $content = Extractor::extract($url); $entry = new Entries(); $entry->setUserId(1); $entry->setUrl($url); - $entry->setTitle($content->getTitle()); + $entry->setTitle($request->request->get('title') ?: $content->getTitle()); $entry->setContent($content->getBody()); $em = $this->getDoctrine()->getManager(); $em->persist($entry);