mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Can get informations about a single post
This commit is contained in:
parent
5174e0b1ae
commit
ce593b5a5c
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user