Dispaly a user message when a recipe is successfully deleted
This commit is contained in:
parent
d86c8ab6fe
commit
ec36391ec8
6 changed files with 182 additions and 166 deletions
|
|
@ -262,11 +262,19 @@ pub fn setup_page(recipe_id: i64) {
|
|||
.is_some()
|
||||
{
|
||||
let body = ron_api::Id { id: recipe_id };
|
||||
let _ = request::delete::<(), _>("recipe", body).await;
|
||||
window()
|
||||
.location()
|
||||
.set_href(&format!("/{}/", get_current_lang()))
|
||||
.unwrap();
|
||||
if let Ok(()) = request::delete::<(), _>("recipe", body).await {
|
||||
window()
|
||||
.location()
|
||||
.set_href(&format!(
|
||||
"/{}/?{}={}&{}={}",
|
||||
get_current_lang(),
|
||||
common::consts::GET_PARAMETER_USER_MESSAGE,
|
||||
common::translation::Sentence::RecipeSuccessfullyDeleted as i64,
|
||||
common::consts::GET_PARAMETER_USER_MESSAGE_LEVEL,
|
||||
common::toast::Level::Success as usize
|
||||
))
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue