This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/answer.git


The following commit(s) were added to refs/heads/test by this push:
     new 6a0f9f15 fix: rename linked page route
6a0f9f15 is described below

commit 6a0f9f15e56447b04e915df94fc60b9b07b54a7d
Author: shuai <[email protected]>
AuthorDate: Wed Sep 10 15:01:13 2025 +0800

    fix: rename linked page route
---
 ui/src/router/routes.ts |  9 ++++++++-
 ui/src/utils/guard.ts   | 10 ++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts
index 09ea4838..3ca8431f 100644
--- a/ui/src/router/routes.ts
+++ b/ui/src/router/routes.ts
@@ -117,7 +117,14 @@ const routes: RouteNode[] = [
             page: 'pages/Questions/Detail',
           },
           {
-            path: 'questions/linked/:qid',
+            path: '/questions/linked/:qid',
+            page: 'pages/Questions/Linked',
+            guard: () => {
+              return guard.linkedRedirect();
+            },
+          },
+          {
+            path: '/linked/:qid',
             page: 'pages/Questions/Linked',
           },
           {
diff --git a/ui/src/utils/guard.ts b/ui/src/utils/guard.ts
index 59011017..24064669 100644
--- a/ui/src/utils/guard.ts
+++ b/ui/src/utils/guard.ts
@@ -400,6 +400,16 @@ export const askRedirect = () => {
   };
 };
 
+export const linkedRedirect = () => {
+  const queryString = window.location.search;
+  const pathname = window.location.pathname.replace('/questions', '');
+
+  return {
+    ok: false,
+    redirect: `${pathname}${queryString}`,
+  };
+};
+
 let appInitialized = false;
 export const setupApp = async () => {
   /**

Reply via email to