aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index d48c7bbb..b9f7efea 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -10,7 +10,6 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
10use Wallabag\CoreBundle\Entity\Entry; 10use Wallabag\CoreBundle\Entity\Entry;
11use Wallabag\CoreBundle\Entity\Tag; 11use Wallabag\CoreBundle\Entity\Tag;
12use Wallabag\CoreBundle\Service\Extractor; 12use Wallabag\CoreBundle\Service\Extractor;
13use Hateoas\HateoasBuilder;
14 13
15class WallabagRestController extends Controller 14class WallabagRestController extends Controller
16{ 15{
@@ -74,8 +73,7 @@ class WallabagRestController extends Controller
74 throw $this->createNotFoundException(); 73 throw $this->createNotFoundException();
75 } 74 }
76 75
77 $hateoas = HateoasBuilder::create()->build(); 76 $json = $this->get('serializer')->serialize($entries, 'json');
78 $json = $hateoas->serialize($entries, 'json');
79 77
80 return new Response($json, 200, array('application/json')); 78 return new Response($json, 200, array('application/json'));
81 } 79 }
@@ -92,8 +90,7 @@ class WallabagRestController extends Controller
92 */ 90 */
93 public function getEntryAction(Entry $entry) 91 public function getEntryAction(Entry $entry)
94 { 92 {
95 $hateoas = HateoasBuilder::create()->build(); 93 $json = $this->get('serializer')->serialize($entry, 'json');
96 $json = $hateoas->serialize($entry, 'json');
97 94
98 return new Response($json, 200, array('application/json')); 95 return new Response($json, 200, array('application/json'));
99 } 96 }
@@ -124,7 +121,9 @@ class WallabagRestController extends Controller
124 $em->persist($entry); 121 $em->persist($entry);
125 $em->flush(); 122 $em->flush();
126 123
127 return $entry; 124 $json = $this->get('serializer')->serialize($entry, 'json');
125
126 return new Response($json, 200, array('application/json'));
128 } 127 }
129 128
130 /** 129 /**