diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/WallabagRestController.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index a0d9d4f3..072e5f85 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -127,11 +127,18 @@ class WallabagRestController extends FOSRestController | |||
127 | * | 127 | * |
128 | * @return JsonResponse | 128 | * @return JsonResponse |
129 | */ | 129 | */ |
130 | public function getEntryAction(Entry $entry) | 130 | public function getEntryAction(Entry $entry, $_format) |
131 | { | 131 | { |
132 | $this->validateAuthentication(); | 132 | $this->validateAuthentication(); |
133 | $this->validateUserAccess($entry->getUser()->getId()); | 133 | $this->validateUserAccess($entry->getUser()->getId()); |
134 | 134 | ||
135 | if ($_format === 'epub') { | ||
136 | return $this->get('wallabag_core.helper.entries_export') | ||
137 | ->setEntries($entry) | ||
138 | ->updateTitle('entry') | ||
139 | ->exportAs($_format); | ||
140 | } | ||
141 | |||
135 | $json = $this->get('serializer')->serialize($entry, 'json'); | 142 | $json = $this->get('serializer')->serialize($entry, 'json'); |
136 | 143 | ||
137 | return (new JsonResponse())->setJson($json); | 144 | return (new JsonResponse())->setJson($json); |