Can get informations about a single post

This commit is contained in:
Pierre 2018-01-16 07:00:13 +01:00
parent 5174e0b1ae
commit ce593b5a5c

View File

@ -69,6 +69,28 @@ class postsController {
return $posts; 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 * Create a post
* *