diff --git a/src/web.rs b/src/web.rs index 1134ce4..ce631a1 100644 --- a/src/web.rs +++ b/src/web.rs @@ -143,8 +143,7 @@ impl App { warp::reply::html(tera.render("task/task_page.html", &ctx).unwrap()) } })) - .or(warp::path("task") - .and(warp::path("create")) + .or(warp::path("create") .map({ let tera = self.tera.clone(); move || { @@ -202,7 +201,7 @@ pub async fn post_task_sort(form: task::Request, db: Arc) -> impl warp pub async fn post_task_create(form: task::Create, db: Arc)-> impl warp::Reply { let date = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap(); tracing::debug!("Got POST on /api/task/create: {:?}, date: {:?}", form, date); - db.create_task(form); + db.create_task(form).await; warp::redirect(warp::http::Uri::from_static("/task")) } diff --git a/templates/task/task_page.html b/templates/task/task_page.html index d1ae6b9..6d1f9f7 100644 --- a/templates/task/task_page.html +++ b/templates/task/task_page.html @@ -4,7 +4,7 @@ {% include "navbar.html" %} -Create issue

+Create issue