diff --git a/src/app.rs b/src/app.rs index 8edd2f8..4bcffff 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,15 +1,16 @@ use leptos::*; use crate::components::{item_form::ItemForm, items_list::ItemsList}; use crate::models::item::Item; +use uuid::Uuid; #[component] pub fn App() -> impl IntoView { let (items_signal, set_items) = create_signal(Vec::::new()); let add_item = move |name: String, description: String, tags: Vec<(String, String)>| { - set_items;(|mut items: Vec| { + set_items.update(|items| { items.push(Item { - id: uuid::Uuid::new_v4().to_string(), + id: Uuid::new_v4().to_string(), name, description, tags, @@ -19,9 +20,9 @@ pub fn App() -> impl IntoView { view! {
-

CompareWare

+

{ "CompareWare" }

- +
} -} \ No newline at end of file +}