mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-27 15:59:29 +00:00
Can get informations about a single comment.
This commit is contained in:
parent
ddd0421592
commit
bb0dc94d96
@ -7,6 +7,27 @@
|
|||||||
|
|
||||||
class commentsController {
|
class commentsController {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get informations about a single comment
|
||||||
|
*
|
||||||
|
* @url POST /comments/get_single
|
||||||
|
*/
|
||||||
|
public function get_single_infos(){
|
||||||
|
|
||||||
|
//Get the comment ID
|
||||||
|
$commentID = getPostCommentIDWithAccess("commentID");
|
||||||
|
|
||||||
|
//Get informations about the comment
|
||||||
|
$infos = components()->comments->get_single($commentID, TRUE);
|
||||||
|
|
||||||
|
//Check for errors
|
||||||
|
if(count($infos) == 0)
|
||||||
|
Rest_fatal_error(500, "Couldn't fetch informations about the comment !");
|
||||||
|
|
||||||
|
//Return informations about the comment
|
||||||
|
return $infos;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit a comment content
|
* Edit a comment content
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user