From 11bab284d40a70af67b0bbcfe881d04fb4763ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Volf?= <66163112+matous-volf@users.noreply.github.com> Date: Sun, 8 Sep 2024 19:52:36 +0200 Subject: [PATCH] feat: restore subtasks on a reoccurring task completion --- src/server/tasks.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/server/tasks.rs b/src/server/tasks.rs index b20d3b6..895551c 100644 --- a/src/server/tasks.rs +++ b/src/server/tasks.rs @@ -9,6 +9,7 @@ use time::util::days_in_year_month; use validator::Validate; use crate::errors::task_error::TaskError; use crate::models::category::{Category, ReoccurrenceInterval}; +use crate::server::subtasks::restore_subtasks_of_task; #[server] pub(crate) async fn create_task(new_task: NewTask) @@ -127,6 +128,8 @@ pub(crate) async fn complete_task(task_id: i32) -> Result, _>(|_| vec![Error::ServerInternal].into())?; } else { new_task.category = Category::Done; }