mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-04 12:14:12 +00:00 
			
		
		
		
	Can get informations about a single comment.
This commit is contained in:
		@@ -7,6 +7,27 @@
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user