Upgraded API to use only Comments object instead of arrays

This commit is contained in:
Pierre
2018-04-21 19:04:58 +02:00
parent a3b005d184
commit 3cfe5df2a7
3 changed files with 12 additions and 40 deletions

View File

@ -528,6 +528,14 @@ class postsController {
//Update visibility level
$infos['visibility_level'] = $this::VISIBILITY_LEVELS_API[$infos['visibility_level']];
//Parse comments if required
if(isset($infos['comments'])){
if($infos['comments'] != null){
foreach($infos['comments'] as $num=>$src)
$infos['comments'][$num] = CommentsController::commentToAPI($src);
}
}
//Return the post ready to be shown
return $infos;
}