aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/app/http
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-01-09 17:19:29 +0800
committercrupest <crupest@outlook.com>2021-01-09 17:19:29 +0800
commit9a0b5de3f02c65b4e4986361de96fec68ae79ff4 (patch)
tree1ee159ad7b4d860a389dcbf9f699da28932a1ebd /FrontEnd/src/app/http
parent079bb671af79f7211a8fc25454eb6591d759d85f (diff)
downloadtimeline-9a0b5de3f02c65b4e4986361de96fec68ae79ff4.tar.gz
timeline-9a0b5de3f02c65b4e4986361de96fec68ae79ff4.tar.bz2
timeline-9a0b5de3f02c65b4e4986361de96fec68ae79ff4.zip
...
Diffstat (limited to 'FrontEnd/src/app/http')
-rw-r--r--FrontEnd/src/app/http/timeline.ts27
1 files changed, 7 insertions, 20 deletions
diff --git a/FrontEnd/src/app/http/timeline.ts b/FrontEnd/src/app/http/timeline.ts
index ed02a65b..228b6105 100644
--- a/FrontEnd/src/app/http/timeline.ts
+++ b/FrontEnd/src/app/http/timeline.ts
@@ -1,6 +1,6 @@
import { AxiosError } from "axios";
-import { updateQueryString, applyQueryParameters } from "../utilities/url";
+import { applyQueryParameters } from "../utilities/url";
import {
axios,
@@ -383,26 +383,13 @@ export class HttpTimelineClient implements IHttpTimelineClient {
includeDeleted?: boolean;
}
): Promise<HttpTimelineGenericPostInfo[]> {
- let url = `${apiBaseUrl}/timelines/${timelineName}/posts`;
- if (query != null) {
- if (query.modifiedSince != null) {
- url = updateQueryString(
- "modifiedSince",
- query.modifiedSince.toISOString(),
- url
- );
- }
- if (query.includeDeleted != null) {
- url = updateQueryString(
- "includeDeleted",
- query.includeDeleted ? "true" : "false",
- url
- );
- }
- }
-
return axios
- .get<RawTimelineGenericPostInfo[]>(url)
+ .get<RawTimelineGenericPostInfo[]>(
+ applyQueryParameters(
+ `${apiBaseUrl}/timelines/${timelineName}/posts`,
+ query
+ )
+ )
.then(extractResponseData)
.catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError))
.catch(convertToForbiddenError)