]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ApiBundle/Controller/EntryRestController.php
Set a starred_at field when an entry is starred.
[github/wallabag/wallabag.git] / src / Wallabag / ApiBundle / Controller / EntryRestController.php
index 9277e1a19f093837efbb34540bc0996b02d32bc0..6db977310666e159fec81ef51558e572cacc3fcf 100644 (file)
@@ -8,6 +8,7 @@ use JMS\Serializer\SerializationContext;
 use Nelmio\ApiDocBundle\Annotation\ApiDoc;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
 use Symfony\Component\HttpKernel\Exception\HttpException;
 use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
 use Wallabag\CoreBundle\Entity\Entry;
@@ -360,7 +361,7 @@ class EntryRestController extends WallabagRestController
         }
 
         if (null !== $data['isStarred']) {
-            $entry->setStarred((bool) $data['isStarred']);
+            $entry->updateStar((bool) $data['isStarred']);
         }
 
         if (!empty($data['tags'])) {
@@ -463,7 +464,7 @@ class EntryRestController extends WallabagRestController
         }
 
         if (null !== $data['isStarred']) {
-            $entry->setStarred((bool) $data['isStarred']);
+            $entry->updateStar((bool) $data['isStarred']);
         }
 
         if (!empty($data['tags'])) {