diff --git a/src/frontend/pages/article/edit.rs b/src/frontend/pages/article/edit.rs index c436a80..652b5b0 100644 --- a/src/frontend/pages/article/edit.rs +++ b/src/frontend/pages/article/edit.rs @@ -1,5 +1,12 @@ use crate::{ - common::{newtypes::ConflictId, ApiConflict, ArticleView, EditArticleForm, Notification}, + common::{ + newtypes::ConflictId, + ApiConflict, + ArticleView, + EditArticleForm, + Notification, + MAIN_PAGE_NAME, + }, frontend::{ api::CLIENT, components::{ @@ -10,7 +17,7 @@ use crate::{ }, }; use leptos::{html::Textarea, prelude::*}; -use leptos_router::hooks::use_params_map; +use leptos_router::{components::Redirect, hooks::use_params_map}; use leptos_use::{use_textarea_autosize, UseTextareaAutosizeReturn}; #[derive(Clone, PartialEq)] @@ -176,8 +183,11 @@ pub fn EditArticle() -> impl IntoView { } } > - - Edit successful! + } } diff --git a/src/frontend/pages/article/read.rs b/src/frontend/pages/article/read.rs index 846bfcb..2b515cb 100644 --- a/src/frontend/pages/article/read.rs +++ b/src/frontend/pages/article/read.rs @@ -4,10 +4,13 @@ use crate::frontend::{ pages::article_resource, }; use leptos::prelude::*; +use leptos_router::hooks::use_query_map; #[component] pub fn ReadArticle() -> impl IntoView { let article = article_resource(); + let query = use_query_map(); + let edit_successful = query.get_untracked().get("edit_successful").is_some(); view! { @@ -26,8 +29,11 @@ pub fn ReadArticle() -> impl IntoView { > } }) - }} - + }} +
+
Edit successful
+
+
} }