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
commitd3cd08d6234332a6f79bdcb080d490c38741e0e0 (patch)
treee02e2cc2385e329ee73c262ef97689e8256ce209 /FrontEnd/src/app/http
parent109deb21f406ac0a9bd49ca7fd87a1ad844050ba (diff)
downloadtimeline-d3cd08d6234332a6f79bdcb080d490c38741e0e0.tar.gz
timeline-d3cd08d6234332a6f79bdcb080d490c38741e0e0.tar.bz2
timeline-d3cd08d6234332a6f79bdcb080d490c38741e0e0.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)