Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

Revert "Fix RouteNode type error"

robin53501a369205
diff --git a/ui/src/router/index.tsx b/ui/src/router/index.tsx
index 7f2f0d3e..99d44723 100644
--- a/ui/src/router/index.tsx
+++ b/ui/src/router/index.tsx
@@ -2,10 +2,9 @@ import React, { Suspense, lazy } from 'react';
import { RouteObject, createBrowserRouter } from 'react-router-dom';
import Layout from '@answer/pages/Layout';
-import routeConfig from '@/router/route-config';
+import routeConfig, { RouteNode } from '@/router/route-config';
import RouteRules from '@/router/route-rules';
-import { RouteNode } from '@/router/types';
const routes: RouteObject[] = [];
diff --git a/ui/src/router/route-config.ts b/ui/src/router/route-config.ts
index 0eb31651..2e46ffbe 100644
--- a/ui/src/router/route-config.ts
+++ b/ui/src/router/route-config.ts
@@ -1,5 +1,10 @@
-import { RouteNode } from '@/router/types';
+import { RouteObject } from 'react-router-dom';
+export interface RouteNode extends RouteObject {
+ page: string;
+ children?: RouteNode[];
+ rules?: string[];
+}
const routeConfig: RouteNode[] = [
{
path: '/',
diff --git a/ui/src/router/types.ts b/ui/src/router/types.ts
deleted file mode 100644
index f0d13c87..00000000
--- a/ui/src/router/types.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-import { IndexRouteObject, NonIndexRouteObject } from 'react-router-dom';
-
-type CustomRouteObject = {
- page: string;
- rules?: string[];
-};
-
-type IndexRouteNode = IndexRouteObject & CustomRouteObject;
-
-interface NonIndexRouteNode extends NonIndexRouteObject, CustomRouteObject {
- children?: (IndexRouteNode | NonIndexRouteNode)[];
-}
-
-export type RouteNode = IndexRouteNode | NonIndexRouteNode;