aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 15:31:49 +0800
committercrupest <crupest@outlook.com>2021-02-13 15:31:49 +0800
commit790fc48e013ecd424d73e45072607927a3a43a70 (patch)
treec39fd481a36a624a9cd444777f1a91b79b9c884d /FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
parent8d4db22c80a5992915abdf6d2b7d8047b93265ff (diff)
downloadtimeline-790fc48e013ecd424d73e45072607927a3a43a70.tar.gz
timeline-790fc48e013ecd424d73e45072607927a3a43a70.tar.bz2
timeline-790fc48e013ecd424d73e45072607927a3a43a70.zip
...
Diffstat (limited to 'FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx')
-rw-r--r--FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx18
1 files changed, 10 insertions, 8 deletions
diff --git a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
index ab3285f5..b99ec267 100644
--- a/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
+++ b/FrontEnd/src/app/views/timeline-common/TimelinePropertyChangeDialog.tsx
@@ -1,19 +1,21 @@
import React from "react";
import {
- TimelineVisibility,
+ getHttpTimelineClient,
+ HttpTimelineInfo,
+ HttpTimelinePatchRequest,
kTimelineVisibilities,
- TimelineChangePropertyRequest,
- TimelineInfo,
-} from "@/services/timeline";
+ TimelineVisibility,
+} from "@/http/timeline";
import OperationDialog from "../common/OperationDialog";
+// TODO: Trigger resync.
+
export interface TimelinePropertyChangeDialogProps {
open: boolean;
close: () => void;
- timeline: TimelineInfo;
- onProcess: (request: TimelineChangePropertyRequest) => Promise<void>;
+ timeline: HttpTimelineInfo;
}
const labelMap: { [key in TimelineVisibility]: string } = {
@@ -54,7 +56,7 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps>
open={props.open}
close={props.close}
onProcess={([newTitle, newVisibility, newDescription]) => {
- const req: TimelineChangePropertyRequest = {};
+ const req: HttpTimelinePatchRequest = {};
if (newTitle !== timeline.title) {
req.title = newTitle;
}
@@ -64,7 +66,7 @@ const TimelinePropertyChangeDialog: React.FC<TimelinePropertyChangeDialogProps>
if (newDescription !== timeline.description) {
req.description = newDescription;
}
- return props.onProcess(req);
+ return getHttpTimelineClient().patchTimeline(timeline.name, req);
}}
/>
);