Go to home after recipe delete
This commit is contained in:
parent
31bc31035a
commit
b5919a43eb
1 changed files with 7 additions and 1 deletions
|
|
@ -1,4 +1,9 @@
|
|||
use gloo::{console::log, events::EventListener, net::http::Request, utils::document};
|
||||
use gloo::{
|
||||
console::log,
|
||||
events::EventListener,
|
||||
net::http::Request,
|
||||
utils::{document, window},
|
||||
};
|
||||
use wasm_bindgen::prelude::*;
|
||||
use wasm_bindgen_futures::spawn_local;
|
||||
use web_sys::{
|
||||
|
|
@ -206,6 +211,7 @@ pub fn recipe_edit(recipe_id: i64) -> Result<(), JsValue> {
|
|||
{
|
||||
let body = ron_api::Remove { recipe_id };
|
||||
let _ = request::delete::<(), _>("recipe/remove", body).await;
|
||||
window().location().set_href("/").unwrap();
|
||||
|
||||
// by_id::<Element>(&format!("group-{}", group_id)).remove();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue