refactor: make the project form component handle the server calls itself
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
use crate::components::project_form::ProjectForm;
|
||||
use crate::server::projects::create_project;
|
||||
use crate::server::projects::{create_project, testing};
|
||||
use dioxus::core_macro::rsx;
|
||||
use dioxus::dioxus_core::Element;
|
||||
use dioxus::prelude::*;
|
||||
@@ -7,12 +7,6 @@ use dioxus::prelude::*;
|
||||
#[component]
|
||||
pub(crate) fn Home() -> Element {
|
||||
rsx! {
|
||||
ProjectForm {
|
||||
onsubmit: move |title| {
|
||||
spawn(async move {
|
||||
create_project(title).await;
|
||||
});
|
||||
}
|
||||
}
|
||||
ProjectForm {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user