diff options
author | crupest <crupest@outlook.com> | 2021-06-03 23:20:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-06-03 23:20:22 +0800 |
commit | 5a96a88121f3ecb846c5cd55c3f51624b4e21402 (patch) | |
tree | 68ebf231a0887440c4390cba494fe43f34050b2d /FrontEnd/src/app/http/timeline.ts | |
parent | b8a43d19cc3e850d42959ca019a3de6a453de11d (diff) | |
download | timeline-5a96a88121f3ecb846c5cd55c3f51624b4e21402.tar.gz timeline-5a96a88121f3ecb846c5cd55c3f51624b4e21402.tar.bz2 timeline-5a96a88121f3ecb846c5cd55c3f51624b4e21402.zip |
feat: Add change post property dialog.
Diffstat (limited to 'FrontEnd/src/app/http/timeline.ts')
-rw-r--r-- | FrontEnd/src/app/http/timeline.ts | 23 |
1 files changed, 23 insertions, 0 deletions
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<HttpTimelinePostInfo>; + patchPost( + timelineName: string, + postId: number, + req: HttpTimelinePostPatchRequest + ): Promise<HttpTimelinePostInfo>; deletePost(timelineName: string, postId: number): Promise<void>; } @@ -189,6 +199,19 @@ export class HttpTimelineClient implements IHttpTimelineClient { .then(extractResponseData); } + patchPost( + timelineName: string, + postId: number, + req: HttpTimelinePostPatchRequest + ): Promise<HttpTimelinePostInfo> { + return axios + .patch<HttpTimelinePostInfo>( + `${apiBaseUrl}/timelines/${timelineName}/posts/${postId}`, + req + ) + .then(extractResponseData); + } + deletePost(timelineName: string, postId: number): Promise<void> { return axios .delete(`${apiBaseUrl}/timelines/${timelineName}/posts/${postId}`) |