From 27f15aa4ca4eb0eff11ddb3f3a2ce6fe945ba0e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 29 Jan 2015 20:32:11 +0100 Subject: improve API --- app/config/config.yml | 2 +- .../CoreBundle/Controller/WallabagRestController.php | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/config/config.yml b/app/config/config.yml index f2f5f9f3..e5c87860 100644 --- a/app/config/config.yml +++ b/app/config/config.yml @@ -101,6 +101,6 @@ fos_rest: failed_validation: HTTP_BAD_REQUEST default_engine: twig routing_loader: - default_format: json + include_format: false nelmio_api_doc: ~ \ No newline at end of file diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php index a2a9af38..eb41d011 100644 --- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php @@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Controller; use Nelmio\ApiDocBundle\Annotation\ApiDoc; use FOS\RestBundle\Controller\Annotations\View; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\HttpFoundation\Request; use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Wallabag\CoreBundle\Entity\Entries; use Wallabag\CoreBundle\Entity\Tags; @@ -20,9 +21,19 @@ class WallabagRestController * ) * @return Entries */ - public function getEntriesAction() + public function getEntriesAction(Request $request) { - + $isArchive = $request->query->get('archive'); + var_dump($isArchive); + $isStarred = $request->query->get('star'); + $isDeleted = $request->query->get('delete'); + $sort = $request->query->get('sort'); + $order = $request->query->get('order'); + $page = $request->query->get('page'); + $perPage = $request->query->get('perPage'); + $tags = $request->query->get('tags', array()); + + return 'plop'; } /** -- cgit v1.2.3