From 9a0b5de3f02c65b4e4986361de96fec68ae79ff4 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 9 Jan 2021 17:19:29 +0800 Subject: ... --- FrontEnd/src/app/http/timeline.ts | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) (limited to 'FrontEnd/src/app/http') 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 { - 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(url) + .get( + applyQueryParameters( + `${apiBaseUrl}/timelines/${timelineName}/posts`, + query + ) + ) .then(extractResponseData) .catch(convertToIfStatusCodeIs(404, HttpTimelineNotExistError)) .catch(convertToForbiddenError) -- cgit v1.2.3