Skip to content

Commit

Permalink
use server fns directly in ActionForm and MultiActionForm
Browse files Browse the repository at this point in the history
  • Loading branch information
gbj committed Jan 9, 2024
1 parent b84ff68 commit 33e88e0
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 210 deletions.
Binary file modified examples/todo_app_sqlite_axum/Todos.db
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/todo_app_sqlite_axum/src/todo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ pub async fn add_todo(title: String) -> Result<(), ServerFnError> {
pub async fn delete_todo(id: u16) -> Result<(), ServerFnError> {
let mut conn = db().await?;

leptos_axum::redirect("/foo");
Ok(sqlx::query("DELETE FROM todos WHERE id = $1")
.bind(id)
.execute(&mut conn)
Expand All @@ -90,7 +89,6 @@ pub fn TodoApp() -> impl IntoView {
//let id = use_context::<String>();
provide_meta_context();
view! {

<Link rel="shortcut icon" type_="image/ico" href="/favicon.ico"/>
<Stylesheet id="leptos" href="/pkg/todo_app_sqlite_axum.css"/>
<Router>
Expand Down
Loading

0 comments on commit 33e88e0

Please sign in to comment.