diff --git a/examples/todo_app_sqlite_csr/Todos.db b/examples/todo_app_sqlite_csr/Todos.db index 949fe69e21..2c64fbdcd1 100644 Binary files a/examples/todo_app_sqlite_csr/Todos.db and b/examples/todo_app_sqlite_csr/Todos.db differ diff --git a/examples/todo_app_sqlite_csr/src/todo.rs b/examples/todo_app_sqlite_csr/src/todo.rs index efea1f2d66..c3175a036f 100644 --- a/examples/todo_app_sqlite_csr/src/todo.rs +++ b/examples/todo_app_sqlite_csr/src/todo.rs @@ -1,6 +1,8 @@ use crate::error_template::ErrorTemplate; use leptos::either::Either; use leptos::prelude::*; +use leptos_router::components::{Route, Router, Routes}; +use leptos_router::path; use serde::{Deserialize, Serialize}; use server_fn::ServerFnError; @@ -77,6 +79,8 @@ pub async fn delete_todo(id: u16) -> Result<(), ServerFnError> { use self::ssr::*; let mut conn = db().await?; + leptos_axum::redirect("/foo"); + Ok(sqlx::query("DELETE FROM todos WHERE id = $1") .bind(id) .execute(&mut conn) @@ -91,11 +95,23 @@ pub fn TodoApp() -> impl IntoView {
"Foo"
+ } +} + #[component] pub fn Todos() -> impl IntoView { let add_todo = ServerMultiAction::