Explorar el Código

:fire: 无用的引用

visuddhinanda hace 3 años
padre
commit
246f975460
Se han modificado 1 ficheros con 5 adiciones y 7 borrados
  1. 5 7
      dashboard/src/components/article/AnthologyDetail.tsx

+ 5 - 7
dashboard/src/components/article/AnthologyDetail.tsx

@@ -12,11 +12,6 @@ import TocTree from "./TocTree";
 
 const { Title, Text } = Typography;
 
-interface IWidgetAnthologyDetail {
-  aid: string;
-  channels?: string[];
-}
-
 const defaultData: IAnthologyData = {
   id: "",
   title: "",
@@ -32,7 +27,10 @@ const defaultData: IAnthologyData = {
   created_at: "",
   updated_at: "",
 };
-
+interface IWidgetAnthologyDetail {
+  aid?: string;
+  channels?: string[];
+}
 const Widget = (prop: IWidgetAnthologyDetail) => {
   const [tableData, setTableData] = useState(defaultData);
 
@@ -41,7 +39,7 @@ const Widget = (prop: IWidgetAnthologyDetail) => {
     fetchData(prop.aid);
   }, [prop.aid]);
 
-  function fetchData(id: string) {
+  function fetchData(id?: string) {
     get<IAnthologyResponse>(`/v2/anthology/${id}`)
       .then((response) => {
         const item: IAnthologyDataResponse = response.data;