diff --git a/api/v1/entries/bug.php b/api/v1/entries/bug.php index 2c39a3348a..71fbb14fd9 100644 --- a/api/v1/entries/bug.php +++ b/api/v1/entries/bug.php @@ -122,6 +122,6 @@ class bugEntry extends entry $control->delete($bugID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/build.php b/api/v1/entries/build.php index c4b54c6fcf..a3aaf99479 100644 --- a/api/v1/entries/build.php +++ b/api/v1/entries/build.php @@ -29,7 +29,7 @@ class buildEntry extends entry /* Exception handling. */ if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); - $this->sendError(400, 'error'); + return $this->sendError(400, 'error'); } /** @@ -71,6 +71,6 @@ class buildEntry extends entry $control->delete($buildID, 'true'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/config.php b/api/v1/entries/config.php index aa34305993..325c673295 100644 --- a/api/v1/entries/config.php +++ b/api/v1/entries/config.php @@ -40,8 +40,7 @@ class configEntry extends baseEntry $config['value'] = $this->config->systemMode; break; default: - $this->sendError(400, 'No configuration.'); - return; + return $this->sendError(400, 'No configuration.'); } return $this->send(200, $config); diff --git a/api/v1/entries/department.php b/api/v1/entries/department.php index 6ea2f315e8..3d2404b165 100644 --- a/api/v1/entries/department.php +++ b/api/v1/entries/department.php @@ -65,6 +65,6 @@ class departmentEntry extends entry $data = $this->getData(); if(isset($data->status) and $data->status == 'fail') return $this->sendError(400, $data->message); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/doc.php b/api/v1/entries/doc.php index 9b3393a64c..8470bf6167 100644 --- a/api/v1/entries/doc.php +++ b/api/v1/entries/doc.php @@ -67,7 +67,7 @@ class docEntry extends entry $this->getData(); $story = $this->story->getByID($storyID); - $this->sendSuccess(200, $this->format($story, 'openedDate:time,assignedDate:time,reviewedDate:time,lastEditedDate:time,closedDate:time,deleted:bool')); + return $this->sendSuccess(200, $this->format($story, 'openedDate:time,assignedDate:time,reviewedDate:time,lastEditedDate:time,closedDate:time,deleted:bool')); } /** @@ -83,6 +83,6 @@ class docEntry extends entry $control->delete($storyID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/execution.php b/api/v1/entries/execution.php index 3ba9d33009..fb3ff254ba 100644 --- a/api/v1/entries/execution.php +++ b/api/v1/entries/execution.php @@ -152,6 +152,6 @@ class executionEntry extends entry $control->delete($executionID, 'true'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/feedback.php b/api/v1/entries/feedback.php index 39ba4523a2..09d5cd7f1e 100644 --- a/api/v1/entries/feedback.php +++ b/api/v1/entries/feedback.php @@ -79,7 +79,7 @@ class feedbackEntry extends entry $control->delete($feedbackID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/issue.php b/api/v1/entries/issue.php index 86d4f8b48f..ece2b26f18 100644 --- a/api/v1/entries/issue.php +++ b/api/v1/entries/issue.php @@ -74,6 +74,6 @@ class issueEntry extends entry $control->delete($issueID, 'true'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/product.php b/api/v1/entries/product.php index 1c3c13a480..2c079844f3 100644 --- a/api/v1/entries/product.php +++ b/api/v1/entries/product.php @@ -136,6 +136,6 @@ class productEntry extends entry $control->delete($productID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/productplan.php b/api/v1/entries/productplan.php index c74030f3a1..48b9deaa7a 100644 --- a/api/v1/entries/productplan.php +++ b/api/v1/entries/productplan.php @@ -87,6 +87,6 @@ class productplanEntry extends entry $control->delete($planID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/program.php b/api/v1/entries/program.php index b051a13c2c..f2d9ee17db 100644 --- a/api/v1/entries/program.php +++ b/api/v1/entries/program.php @@ -65,6 +65,6 @@ class programEntry extends entry $data = $this->getData(); if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/project.php b/api/v1/entries/project.php index d64e4130e9..d719b798d9 100644 --- a/api/v1/entries/project.php +++ b/api/v1/entries/project.php @@ -139,6 +139,6 @@ class projectEntry extends entry $control->delete($projectID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/release.php b/api/v1/entries/release.php index fb881913fb..6c84687a3d 100644 --- a/api/v1/entries/release.php +++ b/api/v1/entries/release.php @@ -54,7 +54,7 @@ class releaseEntry extends entry if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); $release = $this->release->getByID($releaseID); - $this->sendSuccess(200, $this->format($release, 'date:date,deleted:bool')); + return $this->sendSuccess(200, $this->format($release, 'date:date,deleted:bool')); } /** @@ -70,6 +70,6 @@ class releaseEntry extends entry $control->delete($releaseID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/risk.php b/api/v1/entries/risk.php index 9e08b47e66..2334c96b3b 100644 --- a/api/v1/entries/risk.php +++ b/api/v1/entries/risk.php @@ -70,6 +70,6 @@ class riskEntry extends entry $control->delete($riskID, 'true'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/story.php b/api/v1/entries/story.php index fb05989da0..26a6bbfd94 100644 --- a/api/v1/entries/story.php +++ b/api/v1/entries/story.php @@ -124,6 +124,6 @@ class storyEntry extends entry $control->delete($storyID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/storyrecall.php b/api/v1/entries/storyrecall.php index e635a01f36..c2e5d73359 100644 --- a/api/v1/entries/storyrecall.php +++ b/api/v1/entries/storyrecall.php @@ -24,7 +24,7 @@ class storyRecallEntry extends entry $control->recall($storyID); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/task.php b/api/v1/entries/task.php index 402a260102..d31e606d72 100644 --- a/api/v1/entries/task.php +++ b/api/v1/entries/task.php @@ -130,6 +130,6 @@ class taskEntry extends entry $control->delete(0, $taskID, 'true'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/taskfinish.php b/api/v1/entries/taskfinish.php index a28f086d80..654192ec83 100644 --- a/api/v1/entries/taskfinish.php +++ b/api/v1/entries/taskfinish.php @@ -38,6 +38,7 @@ class taskFinishEntry extends entry $data = $this->getData(); if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); + if(isset($data->result) and $data->result == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); $task = $this->loadModel('task')->getByID($taskID); diff --git a/api/v1/entries/taskstart.php b/api/v1/entries/taskstart.php index 99d007e1f2..b29f5abe83 100644 --- a/api/v1/entries/taskstart.php +++ b/api/v1/entries/taskstart.php @@ -32,6 +32,7 @@ class taskStartEntry extends entry $data = $this->getData(); if(!$data) return $this->send400('error'); if(isset($data->status) and $data->status == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); + if(isset($data->result) and $data->result == 'fail') return $this->sendError(zget($data, 'code', 400), $data->message); $task = $this->loadModel('task')->getByID($taskID); diff --git a/api/v1/entries/testcase.php b/api/v1/entries/testcase.php index 28f51a4d23..4dc45c1e03 100644 --- a/api/v1/entries/testcase.php +++ b/api/v1/entries/testcase.php @@ -88,6 +88,6 @@ class testcaseEntry extends entry $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/testsuite.php b/api/v1/entries/testsuite.php index 58cca66be4..8fcb99d29d 100644 --- a/api/v1/entries/testsuite.php +++ b/api/v1/entries/testsuite.php @@ -53,6 +53,6 @@ class testsuiteEntry extends entry $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/testtask.php b/api/v1/entries/testtask.php index 6c7f27ca4e..a76f4d222d 100644 --- a/api/v1/entries/testtask.php +++ b/api/v1/entries/testtask.php @@ -51,6 +51,6 @@ class testtaskEntry extends entry $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/todo.php b/api/v1/entries/todo.php index 4594fda30a..7cf379ddeb 100644 --- a/api/v1/entries/todo.php +++ b/api/v1/entries/todo.php @@ -77,6 +77,6 @@ class todoEntry extends entry $control->delete($todoID, 'yes'); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index f7c0e6c4d4..d419d970d4 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -445,6 +445,6 @@ class userEntry extends entry $control->delete($userID); $this->getData(); - $this->sendSuccess(200, 'success'); + return $this->sendSuccess(200, 'success'); } } diff --git a/framework/api/entry.class.php b/framework/api/entry.class.php index 076508c134..33018ca827 100644 --- a/framework/api/entry.class.php +++ b/framework/api/entry.class.php @@ -465,7 +465,7 @@ class baseEntry { $module = $this->app->moduleName; $name = isset($this->app->lang->$module->$field) ? $this->app->lang->$module->$field : $field; - $this->sendError(400, sprintf($this->app->lang->error->notempty, $name)); + throw EndResponseException::create($this->sendError(400, sprintf($this->app->lang->error->notempty, $name))); } } }