From 5a96a88121f3ecb846c5cd55c3f51624b4e21402 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 3 Jun 2021 23:20:22 +0800 Subject: feat: Add change post property dialog. --- FrontEnd/src/app/http/timeline.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'FrontEnd/src/app/http') diff --git a/FrontEnd/src/app/http/timeline.ts b/FrontEnd/src/app/http/timeline.ts index efc402c1..9697c1a0 100644 --- a/FrontEnd/src/app/http/timeline.ts +++ b/FrontEnd/src/app/http/timeline.ts @@ -77,6 +77,11 @@ export interface HttpTimelinePatchRequest { description?: string; } +export interface HttpTimelinePostPatchRequest { + time?: string; + color?: string; +} + export class HttpTimelineNameConflictError extends Error { constructor(public innerError?: AxiosError) { super(); @@ -101,6 +106,11 @@ export interface IHttpTimelineClient { timelineName: string, req: HttpTimelinePostPostRequest ): Promise; + patchPost( + timelineName: string, + postId: number, + req: HttpTimelinePostPatchRequest + ): Promise; deletePost(timelineName: string, postId: number): Promise; } @@ -189,6 +199,19 @@ export class HttpTimelineClient implements IHttpTimelineClient { .then(extractResponseData); } + patchPost( + timelineName: string, + postId: number, + req: HttpTimelinePostPatchRequest + ): Promise { + return axios + .patch( + `${apiBaseUrl}/timelines/${timelineName}/posts/${postId}`, + req + ) + .then(extractResponseData); + } + deletePost(timelineName: string, postId: number): Promise { return axios .delete(`${apiBaseUrl}/timelines/${timelineName}/posts/${postId}`) -- cgit v1.2.3