diff --git a/RestControllers/conversationsController.php b/RestControllers/conversationsController.php index 4053a41..87804db 100644 --- a/RestControllers/conversationsController.php +++ b/RestControllers/conversationsController.php @@ -67,7 +67,7 @@ class conversationsController{ //Check for parametres if(!check_post_parametres(array("name", "follow", "users"))) - Rest_fatal_error(501, "Please check parametres passed with the request !"); + Rest_fatal_error(400, "Please check parametres passed with the request !"); //Extract parametres $conversationName = ($_POST["name"] == "false" ? false : $_POST['name']); @@ -106,7 +106,7 @@ class conversationsController{ //Check conversation ID was specified if(!isset($_POST["conversationID"])) - Rest_fatal_error("501", "Please specify a conversation ID !"); + Rest_fatal_error(400, "Please specify a conversation ID !"); $conversationID = toInt($_POST["conversationID"]); //Check if the user is a conversation moderator or not @@ -156,4 +156,19 @@ class conversationsController{ //Success return array("success" => "Conversation informations were successfully updated !"); } + + /** + * Find (create ?) and return private conversation ID + * + * @url POST /conversations/getPrivate + */ + public function findPrivate(){ + + user_login_required(); + + //Check for parametres + if(!isset($_POST['user1']) OR !isset($_POST['user2'])) + Rest_fatal_error(400, "Please check your parametres") + + } } \ No newline at end of file diff --git a/RestControllers/friendsController.php b/RestControllers/friendsController.php index 22e1978..0ddc510 100644 --- a/RestControllers/friendsController.php +++ b/RestControllers/friendsController.php @@ -36,7 +36,7 @@ class friendsController{ //Check parametres if(!isset($_POST["friendID"]) OR !isset($_POST['accept'])) - Rest_fatal_error(501, "Please check your parametres !"); + Rest_fatal_error(400, "Please check your parametres !"); //Extract informations and process request $friendID = toInt($_POST['friendID']); diff --git a/RestControllers/userController.php b/RestControllers/userController.php index 05d8052..08db42a 100644 --- a/RestControllers/userController.php +++ b/RestControllers/userController.php @@ -18,7 +18,7 @@ class userController public function connectUSER(){ //Check variables sent in request if(!isset($_POST['userMail']) OR !isset($_POST['userPassword'])) - throw new RestException(401, "Missing data !"); + throw new RestException(400, "Missing data !"); //Retrieve database connection $db = CS::get()->db;;