Update task time spent/estimated when removing a subtask

Fixes #3811
This commit is contained in:
Frédéric Guillot
2023-02-13 20:29:33 -08:00
committed by Frédéric Guillot
parent 277357277f
commit d0941ccd4e
2 changed files with 37 additions and 1 deletions

View File

@@ -267,7 +267,13 @@ class SubtaskModel extends Base
public function remove($subtaskId)
{
$this->subtaskEventJob->execute($subtaskId, array(self::EVENT_DELETE));
return $this->db->table(self::TABLE)->eq('id', $subtaskId)->remove();
$subtask = $this->getById($subtaskId);
$result = $this->db->table(self::TABLE)->eq('id', $subtaskId)->remove();
$this->subtaskTimeTrackingModel->updateTaskTimeTracking($subtask['task_id']);
return $result;
}
/**