mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09: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;
|
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
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user