aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/http/bookmark.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-11 21:58:32 +0800
committerGitHub <noreply@github.com>2021-01-11 21:58:32 +0800
commit5f08a5afe39fb680a14982255d366335bcef5d6e (patch)
tree9deed1bab5913de2e2e31e1b7a8f14e7ee699cf8 /FrontEnd/src/app/http/bookmark.ts
parent6d30c089c02591ce2f57cf22fe0c41c17c62fbc3 (diff)
parent21ee6d4b78566a857559c5e393ae85731d380092 (diff)
downloadtimeline-5f08a5afe39fb680a14982255d366335bcef5d6e.tar.gz
timeline-5f08a5afe39fb680a14982255d366335bcef5d6e.tar.bz2
timeline-5f08a5afe39fb680a14982255d366335bcef5d6e.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.ts27
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();
}