瀏覽代碼

rename IMilestoneResponse -》IUserMilestoneResponse

visuddhinanda 1 年之前
父節點
當前提交
37b80d929f
共有 1 個文件被更改,包括 16 次插入14 次删除
  1. 16 14
      dashboard-v4/dashboard/src/components/blog/TimeLine.tsx

+ 16 - 14
dashboard-v4/dashboard/src/components/blog/TimeLine.tsx

@@ -1,7 +1,7 @@
 import { Timeline } from "antd";
 import { useEffect, useState } from "react";
 import { useIntl } from "react-intl";
-import { StartUpIcon, TermIcon2, TermOutlinedIcon } from "../../assets/icon";
+import { StartUpIcon, TermIcon2 } from "../../assets/icon";
 import { get } from "../../request";
 import TimeShow from "../general/TimeShow";
 
@@ -9,7 +9,7 @@ interface IMilestone {
   date: string;
   event: string;
 }
-interface IMilestoneResponse {
+interface IUserMilestoneResponse {
   ok: boolean;
   message: string;
   data: IMilestone[];
@@ -26,19 +26,21 @@ const TimeLineWidget = ({ studioName }: IWidget) => {
     if (typeof studioName === "undefined") {
       return;
     }
-    get<IMilestoneResponse>(`/v2/milestone/${studioName}`).then((json) => {
-      if (json.ok) {
-        setMilestone(
-          json.data.sort((a, b) => {
-            if (a.date > b.date) {
-              return -1;
-            } else {
-              return 1;
-            }
-          })
-        );
+    get<IUserMilestoneResponse>(`/v2/user-milestone/${studioName}`).then(
+      (json) => {
+        if (json.ok) {
+          setMilestone(
+            json.data.sort((a, b) => {
+              if (a.date > b.date) {
+                return -1;
+              } else {
+                return 1;
+              }
+            })
+          );
+        }
       }
-    });
+    );
   }, [studioName]);
 
   return (