diff options
| author | crupest <crupest@outlook.com> | 2021-01-11 21:58:32 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-11 21:58:32 +0800 | 
| commit | 5d3a3111bbc349d5d5ff0a4ed92f97b14a9d65fe (patch) | |
| tree | d635081fb6eaa0222270bfb4ac29906fb767a9bd /FrontEnd/src/app/http/bookmark.ts | |
| parent | 777efa6e0405f4e871de4da21b939e30ed07f754 (diff) | |
| parent | 26f02d90c2571251b32c3b03b970dd290e3892e6 (diff) | |
| download | timeline-5d3a3111bbc349d5d5ff0a4ed92f97b14a9d65fe.tar.gz timeline-5d3a3111bbc349d5d5ff0a4ed92f97b14a9d65fe.tar.bz2 timeline-5d3a3111bbc349d5d5ff0a4ed92f97b14a9d65fe.zip  | |
Merge pull request #206 from crupest/front-dev
Front development.
Diffstat (limited to 'FrontEnd/src/app/http/bookmark.ts')
| -rw-r--r-- | FrontEnd/src/app/http/bookmark.ts | 27 | 
1 files changed, 13 insertions, 14 deletions
diff --git a/FrontEnd/src/app/http/bookmark.ts b/FrontEnd/src/app/http/bookmark.ts index 68de4d73..15e55d98 100644 --- a/FrontEnd/src/app/http/bookmark.ts +++ b/FrontEnd/src/app/http/bookmark.ts @@ -1,6 +1,5 @@ -import axios from "axios"; -  import { +  axios,    apiBaseUrl,    convertToNetworkError,    extractResponseData, @@ -18,38 +17,38 @@ export interface HttpHighlightMoveRequest {  }  export interface IHttpBookmarkClient { -  list(token: string): Promise<HttpTimelineInfo[]>; -  put(timeline: string, token: string): Promise<void>; -  delete(timeline: string, token: string): Promise<void>; -  move(req: HttpHighlightMoveRequest, token: string): Promise<void>; +  list(): Promise<HttpTimelineInfo[]>; +  put(timeline: string): Promise<void>; +  delete(timeline: string): Promise<void>; +  move(req: HttpHighlightMoveRequest): Promise<void>;  }  export class HttpHighlightClient implements IHttpBookmarkClient { -  list(token: string): Promise<HttpTimelineInfo[]> { +  list(): Promise<HttpTimelineInfo[]> {      return axios -      .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/bookmarks?token=${token}`) +      .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/bookmarks`)        .then(extractResponseData)        .then((list) => list.map(processRawTimelineInfo))        .catch(convertToNetworkError);    } -  put(timeline: string, token: string): Promise<void> { +  put(timeline: string): Promise<void> {      return axios -      .put(`${apiBaseUrl}/bookmarks/${timeline}?token=${token}`) +      .put(`${apiBaseUrl}/bookmarks/${timeline}`)        .catch(convertToNetworkError)        .then();    } -  delete(timeline: string, token: string): Promise<void> { +  delete(timeline: string): Promise<void> {      return axios -      .delete(`${apiBaseUrl}/bookmarks/${timeline}?token=${token}`) +      .delete(`${apiBaseUrl}/bookmarks/${timeline}`)        .catch(convertToNetworkError)        .then();    } -  move(req: HttpHighlightMoveRequest, token: string): Promise<void> { +  move(req: HttpHighlightMoveRequest): Promise<void> {      return axios -      .post(`${apiBaseUrl}/bookmarkop/move?token=${token}`, req) +      .post(`${apiBaseUrl}/bookmarkop/move`, req)        .catch(convertToNetworkError)        .then();    }  | 
