diff --git a/RestControllers/postsController.php b/RestControllers/postsController.php index 53bdb94..74b18b5 100644 --- a/RestControllers/postsController.php +++ b/RestControllers/postsController.php @@ -69,6 +69,28 @@ class postsController { return $posts; } + /** + * Get informations about a single post + * + * @url POST /posts/get_single + */ + public function get_single_post(){ + + //Get the post ID + $postID = getPostPostIDWithAccess("postID"); + + //Get informations about the post + $postInfos = components()->posts->get_single($postID, true); + + //Check for errors + if(count($postInfos) == 0) + Rest_fatal_error(500, "Couldn't retrieve post informations !"); + + //Return informations about the post + return $postInfos; + + } + /** * Create a post *