summaryrefslogtreecommitdiff
path: root/app/Controller/Subtask.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controller/Subtask.php')
-rw-r--r--app/Controller/Subtask.php10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/Controller/Subtask.php b/app/Controller/Subtask.php
index bc50b5e1..e48e7767 100644
--- a/app/Controller/Subtask.php
+++ b/app/Controller/Subtask.php
@@ -183,15 +183,9 @@ class Subtask extends Base
public function toggleStatus()
{
$task = $this->getTask();
- $subtask = $this->getSubtask();
-
- $value = array(
- 'id' => $subtask['id'],
- 'status' => ($subtask['status'] + 1) % 3,
- 'task_id' => $task['id'],
- );
+ $subtask_id = $this->request->getIntegerParam('subtask_id');
- if (! $this->subTask->update($value)) {
+ if (! $this->subTask->toggleStatus($subtask_id)) {
$this->session->flashError(t('Unable to update your sub-task.'));
}