diff options
author | crupest <crupest@outlook.com> | 2021-01-31 15:47:29 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-01-31 15:47:29 +0800 |
commit | 8b244ef8ad5f7c333fee4c39e3041846b87f0740 (patch) | |
tree | 354bbfc843fa6ebab2ed98437ee9a5e019c66974 | |
parent | 7f88e120aba0f218641084aca4f467ffd27981d9 (diff) | |
download | timeline-8b244ef8ad5f7c333fee4c39e3041846b87f0740.tar.gz timeline-8b244ef8ad5f7c333fee4c39e3041846b87f0740.tar.bz2 timeline-8b244ef8ad5f7c333fee4c39e3041846b87f0740.zip |
...
-rw-r--r-- | FrontEnd/src/app/http/timeline.ts | 49 |
1 files changed, 5 insertions, 44 deletions
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<HttpTimelineInfo[]>; getTimeline(timelineName: string): Promise<HttpTimelineInfo>; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - } - ): Promise<HttpTimelineInfo>; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - ifModifiedSince: Date; - } - ): Promise<HttpTimelineInfo | NotModified>; postTimeline(req: HttpTimelinePostRequest): Promise<HttpTimelineInfo>; patchTimeline( timelineName: string, @@ -281,38 +269,11 @@ export class HttpTimelineClient implements IHttpTimelineClient { .catch(convertToNetworkError); } - getTimeline(timelineName: string): Promise<HttpTimelineInfo>; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - } - ): Promise<HttpTimelineInfo>; - getTimeline( - timelineName: string, - query: { - checkUniqueId?: string; - ifModifiedSince: Date; - } - ): Promise<HttpTimelineInfo | NotModified>; - getTimeline( - timelineName: string, - query?: { - checkUniqueId?: string; - ifModifiedSince?: Date; - } - ): Promise<HttpTimelineInfo | NotModified> { + getTimeline(timelineName: string): Promise<HttpTimelineInfo> { return axios - .get<RawHttpTimelineInfo>( - applyQueryParameters(`${apiBaseUrl}/timelines/${timelineName}`, query) - ) - .then((res) => { - if (res.status === 304) { - return new NotModified(); - } else { - return processRawTimelineInfo(res.data); - } - }) + .get<RawHttpTimelineInfo>(`${apiBaseUrl}/timelines/${timelineName}`) + .then(extractResponseData) + .then(processRawTimelineInfo) .catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError)) .catch(convertToNetworkError); } |