rpicms

A CMS for the Raspberry Pi
git clone git://archive.git.mtrnord.blog/RpicmsTeam/rpicms.git
Log | Files | Refs | README | LICENSE

commit c6ecac1ed72a4ec0b6e766c48f69d327bd0161ff
parent bffd44d01aee033d0c9937f8da1e625530267fe0
Author: MTRNord <mtrnord1@gmail.com>
Date:   Wed, 18 Mar 2015 19:49:54 +0100

remove not needed param

Diffstat:
Mcore/api/v1/DbHandler.class.php | 4++--
Mcore/api/v1/api.php | 8++++----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/core/api/v1/DbHandler.class.php b/core/api/v1/DbHandler.class.php @@ -239,9 +239,9 @@ class DbHandler { * Fetching single task * @param String $task_id id of the task */ - public function getPosts($task_id, $user_id) { + public function getPosts($task_id) { $stmt = $this->conn->prepare("SELECT t.id, t.task, t.status, t.created_at from tasks t, user_tasks ut WHERE t.id = ? AND ut.task_id = t.id AND ut.user_id = ?"); - $stmt->bind_param("ii", $task_id, $user_id); + $stmt->bind_param("ii", $task_id); if ($stmt->execute()) { $task = $stmt->get_result()->fetch_assoc(); $stmt->close(); diff --git a/core/api/v1/api.php b/core/api/v1/api.php @@ -152,7 +152,7 @@ $app->get('/posts/:id', function($task_id) { $db = new DbHandler(); // fetch task - $result = $db->getPosts($task_id, $user_id); + $result = $db->getPosts($task_id); if ($result != NULL) { $response["error"] = false; @@ -180,7 +180,7 @@ $app->get('/posts/', function() { $db = new DbHandler(); // fetch task - $result = $db->getPosts(Null, $user_id); + $result = $db->getPosts(Null); if ($result != NULL) { $response["error"] = false; @@ -205,9 +205,9 @@ $app->get('/posts/', function() { * Creating new Post in db * method POST * params - name - * url - /addpost/ + * url - /createpost/ */ -$app->Post('/createposts', 'authenticate', function() use ($app) { +$app->Post('/createpost', 'authenticate', function() use ($app) { // check for required params verifyRequiredParams(array('task'));