mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-16 10:22:14 +01:00
API: getEntry can return EPUB
This commit is contained in:
parent
3d4b0b3064
commit
24de866534
@ -127,11 +127,18 @@ class WallabagRestController extends FOSRestController
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function getEntryAction(Entry $entry)
|
||||
public function getEntryAction(Entry $entry, $_format)
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
$this->validateUserAccess($entry->getUser()->getId());
|
||||
|
||||
if ($_format === 'epub') {
|
||||
return $this->get('wallabag_core.helper.entries_export')
|
||||
->setEntries($entry)
|
||||
->updateTitle('entry')
|
||||
->exportAs($_format);
|
||||
}
|
||||
|
||||
$json = $this->get('serializer')->serialize($entry, 'json');
|
||||
|
||||
return (new JsonResponse())->setJson($json);
|
||||
|
Loading…
Reference in New Issue
Block a user