aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/http/highlight.ts
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-02-13 11:58:36 +0800
committercrupest <crupest@outlook.com>2021-02-13 11:58:36 +0800
commit6159c8fd8e4d9ded22b9d5dd1772b1529a1d513a (patch)
tree7ae2fd68896dcd426dd6bb5183680ac226f468cf /FrontEnd/src/app/http/highlight.ts
parent99d525560f6aefa5f5fb63e3ba2fff3b557d61f6 (diff)
downloadtimeline-6159c8fd8e4d9ded22b9d5dd1772b1529a1d513a.tar.gz
timeline-6159c8fd8e4d9ded22b9d5dd1772b1529a1d513a.tar.bz2
timeline-6159c8fd8e4d9ded22b9d5dd1772b1529a1d513a.zip
...
Diffstat (limited to 'FrontEnd/src/app/http/highlight.ts')
-rw-r--r--FrontEnd/src/app/http/highlight.ts34
1 files changed, 7 insertions, 27 deletions
diff --git a/FrontEnd/src/app/http/highlight.ts b/FrontEnd/src/app/http/highlight.ts
index 851d52ce..fddf0729 100644
--- a/FrontEnd/src/app/http/highlight.ts
+++ b/FrontEnd/src/app/http/highlight.ts
@@ -1,15 +1,6 @@
-import {
- axios,
- apiBaseUrl,
- convertToNetworkError,
- extractResponseData,
-} from "./common";
+import { axios, apiBaseUrl, extractResponseData } from "./common";
-import {
- HttpTimelineInfo,
- processRawTimelineInfo,
- RawHttpTimelineInfo,
-} from "./timeline";
+import { HttpTimelineInfo } from "./timeline";
export interface HttpHighlightMoveRequest {
timeline: string;
@@ -26,31 +17,20 @@ export interface IHttpHighlightClient {
export class HttpHighlightClient implements IHttpHighlightClient {
list(): Promise<HttpTimelineInfo[]> {
return axios
- .get<RawHttpTimelineInfo[]>(`${apiBaseUrl}/highlights`)
- .then(extractResponseData)
- .then((list) => list.map(processRawTimelineInfo))
- .catch(convertToNetworkError);
+ .get<HttpTimelineInfo[]>(`${apiBaseUrl}/highlights`)
+ .then(extractResponseData);
}
put(timeline: string): Promise<void> {
- return axios
- .put(`${apiBaseUrl}/highlights/${timeline}`)
- .catch(convertToNetworkError)
- .then();
+ return axios.put(`${apiBaseUrl}/highlights/${timeline}`).then();
}
delete(timeline: string): Promise<void> {
- return axios
- .delete(`${apiBaseUrl}/highlights/${timeline}`)
- .catch(convertToNetworkError)
- .then();
+ return axios.delete(`${apiBaseUrl}/highlights/${timeline}`).then();
}
move(req: HttpHighlightMoveRequest): Promise<void> {
- return axios
- .post(`${apiBaseUrl}/highlightop/move`, req)
- .catch(convertToNetworkError)
- .then();
+ return axios.post(`${apiBaseUrl}/highlightop/move`, req).then();
}
}