From 646b904dec11f59fe8c3a178b9dea735cdf31175 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 31 Jan 2021 15:47:29 +0800 Subject: ... --- FrontEnd/src/app/http/timeline.ts | 49 ++++----------------------------------- 1 file changed, 5 insertions(+), 44 deletions(-) (limited to 'FrontEnd/src') diff --git a/FrontEnd/src/app/http/timeline.ts b/FrontEnd/src/app/http/timeline.ts index 228b6105..68fee5ae 100644 --- a/FrontEnd/src/app/http/timeline.ts +++ b/FrontEnd/src/app/http/timeline.ts @@ -99,6 +99,7 @@ export interface HttpTimelinePostPostRequest { } export interface HttpTimelinePatchRequest { + name?: string; title?: string; visibility?: TimelineVisibility; description?: string; @@ -221,19 +222,6 @@ function processRawTimelinePostInfo( export interface IHttpTimelineClient { listTimeline(query: HttpTimelineListQuery): Promise; getTimeline(timelineName: string): Promise; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - } - ): Promise; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - ifModifiedSince: Date; - } - ): Promise; postTimeline(req: HttpTimelinePostRequest): Promise; patchTimeline( timelineName: string, @@ -281,38 +269,11 @@ export class HttpTimelineClient implements IHttpTimelineClient { .catch(convertToNetworkError); } - getTimeline(timelineName: string): Promise; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - } - ): Promise; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - ifModifiedSince: Date; - } - ): Promise; - getTimeline( - timelineName: string, - query?: { - checkUniqueId?: string; - ifModifiedSince?: Date; - } - ): Promise { + getTimeline(timelineName: string): Promise { return axios - .get( - applyQueryParameters(`${apiBaseUrl}/timelines/${timelineName}`, query) - ) - .then((res) => { - if (res.status === 304) { - return new NotModified(); - } else { - return processRawTimelineInfo(res.data); - } - }) + .get(`${apiBaseUrl}/timelines/${timelineName}`) + .then(extractResponseData) + .then(processRawTimelineInfo) .catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError)) .catch(convertToNetworkError); } -- cgit v1.2.3