mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Implement story routes in API
This commit is contained in:
@@ -1240,6 +1240,30 @@ class API_V1_adapter extends API_V1_Abstract
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return detailed informations about one story
|
||||
*
|
||||
* @param Request $request
|
||||
* @param int $databox_id
|
||||
* @param int $story_id
|
||||
* @return API_V1_result
|
||||
*/
|
||||
public function get_story(Request $request, $databox_id, $story_id)
|
||||
{
|
||||
$result = new API_V1_result($request, $this);
|
||||
$databox = $this->appbox->get_databox($databox_id);
|
||||
try {
|
||||
$story = $databox->get_record($story_id);
|
||||
$result->set_datas(array('story' => $this->list_story($story)));
|
||||
} catch (Exception_NotFound $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('Story Not Found'));
|
||||
} catch (Exception $e) {
|
||||
$result->set_error_message(API_V1_result::ERROR_BAD_REQUEST, _('An error occured'));
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the baskets list of the authenticated user
|
||||
*
|
||||
|
Reference in New Issue
Block a user