1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-17 17:08:37 +00:00

Fix rest controller merge

This commit is contained in:
Jeremy Benoist 2016-11-03 17:29:16 +01:00
parent 5a619812ca
commit 864c1dd23a
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
4 changed files with 141 additions and 0 deletions

View file

@ -150,6 +150,28 @@ class EntryRestController extends WallabagRestController
return (new JsonResponse())->setJson($json);
}
/**
* Retrieve a single entry as a predefined format.
*
* @ApiDoc(
* requirements={
* {"name"="entry", "dataType"="integer", "requirement"="\w+", "description"="The entry ID"}
* }
* )
*
* @return Response
*/
public function getEntryExportAction(Entry $entry, Request $request)
{
$this->validateAuthentication();
$this->validateUserAccess($entry->getUser()->getId());
return $this->get('wallabag_core.helper.entries_export')
->setEntries($entry)
->updateTitle('entry')
->exportAs($request->attributes->get('_format'));
}
/**
* Create an entry.
*