mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-30 17:26:35 +00:00
Enabled likes on posts
This commit is contained in:
parent
7f6ac13d7d
commit
debbdbc7ca
@ -44,9 +44,23 @@ class likesController {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
//In case of post
|
||||||
|
case "post":
|
||||||
|
|
||||||
|
//Extract informations
|
||||||
|
$id = getPostPostID("id");
|
||||||
|
$componentType = Likes::LIKE_POST;
|
||||||
|
|
||||||
|
//Check user can see the post
|
||||||
|
if(CS::get()->components->posts->access_level($id, userID) === Posts::NO_ACCESS)
|
||||||
|
Rest_fatal_error(401, "You are not allowed to access this post informations !");
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
//Default case : error
|
//Default case : error
|
||||||
default:
|
default:
|
||||||
Rest_fatal_error(404, "Didn't find specified component type !");
|
Rest_fatal_error(404, "Specifed component type currently not supported !");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update like status
|
//Update like status
|
||||||
|
Loading…
Reference in New Issue
Block a user