diff --git a/README.md b/README.md index b79a716..249fde2 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,6 @@ WantedBy=multi-user.target [x] formulaire [ ] recap capteurs - - - ## style [Simple dark dashboard](https://dribbble.com/shots/10090105-Dashboard-UI/attachments/2097885?mode=media) diff --git a/src/models/link.rs b/src/models/link.rs index 575feea..503a69b 100644 --- a/src/models/link.rs +++ b/src/models/link.rs @@ -88,4 +88,11 @@ impl Link { } } } + + #[cfg(feature = "ssr")] + pub async fn destroy(id: String) -> Result { + sqlx::query!("DELETE FROM links WHERE id = ? ", id,) + .execute(crate::database::get_db()) + .await + } } diff --git a/src/routes/link.rs b/src/routes/link.rs index 619dde6..a52ff97 100644 --- a/src/routes/link.rs +++ b/src/routes/link.rs @@ -1,8 +1,6 @@ -use ev::MouseEvent; use leptos::*; -use leptos_meta::*; +//use leptos_meta::*; use leptos_router::*; -use wasm_bindgen::JsCast; #[server(GetLinksAction, "/api", "GetJson")] #[tracing::instrument] @@ -37,25 +35,12 @@ pub fn Links() -> impl IntoView { let links = create_resource( move || (result.get()), move |_| async move { - logging::log!("fetch"); reset_form.set(""); set_show.set(false); get_links().await }, ); - create_effect(move |_| { - logging::log!("here .refetch() runs effect instead of get_q_sort.get()"); - logging::log!("{:?}", links.get()); - }); - - async fn move_click_position(id: String) { - logging::log!("move click {}", id); - change_position(id, "prev".to_string()) - .await - .expect("REASON"); - } - let form = move || { show.get().then(|| { view! {
@@ -85,7 +70,7 @@ pub fn Links() -> impl IntoView { }; view! { -