From 303f66d90472716191ae71377b3e83e1537089aa Mon Sep 17 00:00:00 2001
From: crupest <crupest@outlook.com>
Date: Sat, 13 Feb 2021 11:58:36 +0800
Subject: ...

---
 FrontEnd/src/app/views/home/TimelineCreateDialog.tsx | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

(limited to 'FrontEnd/src/app/views/home/TimelineCreateDialog.tsx')

diff --git a/FrontEnd/src/app/views/home/TimelineCreateDialog.tsx b/FrontEnd/src/app/views/home/TimelineCreateDialog.tsx
index 5dcba612..b4e25ba1 100644
--- a/FrontEnd/src/app/views/home/TimelineCreateDialog.tsx
+++ b/FrontEnd/src/app/views/home/TimelineCreateDialog.tsx
@@ -1,12 +1,9 @@
 import React from "react";
 import { useHistory } from "react-router";
 
-import {
-  validateTimelineName,
-  timelineService,
-  TimelineInfo,
-} from "@/services/timeline";
+import { validateTimelineName } from "@/services/timeline";
 import OperationDialog from "../common/OperationDialog";
+import { getHttpTimelineClient, HttpTimelineInfo } from "@/http/timeline";
 
 interface TimelineCreateDialogProps {
   open: boolean;
@@ -42,10 +39,10 @@ const TimelineCreateDialog: React.FC<TimelineCreateDialogProps> = (props) => {
           return null;
         }
       }}
-      onProcess={([name]): Promise<TimelineInfo> => {
-        return timelineService.createTimeline(name).toPromise();
-      }}
-      onSuccessAndClose={(timeline: TimelineInfo) => {
+      onProcess={([name]): Promise<HttpTimelineInfo> =>
+        getHttpTimelineClient().postTimeline({ name })
+      }
+      onSuccessAndClose={(timeline: HttpTimelineInfo) => {
         history.push(`timelines/${timeline.name}`);
       }}
       failurePrompt={(e) => `${e as string}`}
-- 
cgit v1.2.3

