aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/http/timeline.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-03 19:38:05 +0800
committerGitHub <noreply@github.com>2021-01-03 19:38:05 +0800
commitd6f5cc98880b4664baf223d7147feb466e3cce5d (patch)
treeccc1167e69d7e8fcc58760e2d7de3a534150cff3 /FrontEnd/src/app/http/timeline.ts
parentd25b74fa167944a7701997e34810a2ffc3c39edd (diff)
parent1b7a9096b1fd7c26a9336950a4a4b4253bcb5926 (diff)
downloadtimeline-d6f5cc98880b4664baf223d7147feb466e3cce5d.tar.gz
timeline-d6f5cc98880b4664baf223d7147feb466e3cce5d.tar.bz2
timeline-d6f5cc98880b4664baf223d7147feb466e3cce5d.zip
Merge pull request #197 from crupest/front-dev
Front: Highlight and bookmark timeline and new home page.
Diffstat (limited to 'FrontEnd/src/app/http/timeline.ts')
-rw-r--r--FrontEnd/src/app/http/timeline.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/FrontEnd/src/app/http/timeline.ts b/FrontEnd/src/app/http/timeline.ts
index 71c49852..6be0a183 100644
--- a/FrontEnd/src/app/http/timeline.ts
+++ b/FrontEnd/src/app/http/timeline.ts
@@ -121,7 +121,7 @@ export class HttpTimelineNameConflictError extends Error {
//-------------------- begin: internal model --------------------
-interface RawTimelineInfo {
+export interface RawHttpTimelineInfo {
uniqueId: string;
title: string;
name: string;
@@ -188,7 +188,9 @@ interface RawTimelinePostPostRequest {
//-------------------- end: internal model --------------------
-function processRawTimelineInfo(raw: RawTimelineInfo): HttpTimelineInfo {
+export function processRawTimelineInfo(
+ raw: RawHttpTimelineInfo
+): HttpTimelineInfo {
return {
...raw,
lastModified: new Date(raw.lastModified),
@@ -293,7 +295,7 @@ export interface IHttpTimelineClient {
export class HttpTimelineClient implements IHttpTimelineClient {
listTimeline(query: HttpTimelineListQuery): Promise<HttpTimelineInfo[]> {
return axios
- .get<RawTimelineInfo[]>(
+ .get<RawHttpTimelineInfo[]>(
applyQueryParameters(`${apiBaseUrl}/timelines`, query)
)
.then(extractResponseData)
@@ -323,7 +325,7 @@ export class HttpTimelineClient implements IHttpTimelineClient {
}
): Promise<HttpTimelineInfo | NotModified> {
return axios
- .get<RawTimelineInfo>(
+ .get<RawHttpTimelineInfo>(
applyQueryParameters(`${apiBaseUrl}/timelines/${timelineName}`, query)
)
.then((res) => {
@@ -342,7 +344,7 @@ export class HttpTimelineClient implements IHttpTimelineClient {
token: string
): Promise<HttpTimelineInfo> {
return axios
- .post<RawTimelineInfo>(`${apiBaseUrl}/timelines?token=${token}`, req)
+ .post<RawHttpTimelineInfo>(`${apiBaseUrl}/timelines?token=${token}`, req)
.then(extractResponseData)
.then(processRawTimelineInfo)
.catch(convertToIfErrorCodeIs(11040101, HttpTimelineNameConflictError))
@@ -355,7 +357,7 @@ export class HttpTimelineClient implements IHttpTimelineClient {
token: string
): Promise<HttpTimelineInfo> {
return axios
- .patch<RawTimelineInfo>(
+ .patch<RawHttpTimelineInfo>(
`${apiBaseUrl}/timelines/${timelineName}?token=${token}`,
req
)