diff options
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}`) |