aboutsummaryrefslogtreecommitdiff
path: root/FrontEnd/src/http
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-04-12 15:18:47 +0800
committercrupest <crupest@outlook.com>2022-04-12 15:18:47 +0800
commit175223fc3be512db4a939584c989d7e5d7b6832e (patch)
tree0b07536ba2815bd43da0f14d055dce1a4d8fcedd /FrontEnd/src/http
parentca1df3734b825cd0ee5bb1964a544371fb49e7a5 (diff)
downloadtimeline-175223fc3be512db4a939584c989d7e5d7b6832e.tar.gz
timeline-175223fc3be512db4a939584c989d7e5d7b6832e.tar.bz2
timeline-175223fc3be512db4a939584c989d7e5d7b6832e.zip
...
Diffstat (limited to 'FrontEnd/src/http')
-rw-r--r--FrontEnd/src/http/timeline.ts24
1 files changed, 21 insertions, 3 deletions
diff --git a/FrontEnd/src/http/timeline.ts b/FrontEnd/src/http/timeline.ts
index 65717a83..0e1ceb81 100644
--- a/FrontEnd/src/http/timeline.ts
+++ b/FrontEnd/src/http/timeline.ts
@@ -50,6 +50,7 @@ export interface HttpTimelinePostDataDigest {
export interface HttpTimelinePostInfo {
id: number;
+ deleted: false;
time: string;
author: HttpUser;
dataList: HttpTimelinePostDataDigest[];
@@ -60,6 +61,23 @@ export interface HttpTimelinePostInfo {
editable: boolean;
}
+export interface HttpTimelineDeletedPostInfo {
+ id: number;
+ deleted: true;
+ time: string;
+ author?: HttpUser;
+ dataList: HttpTimelinePostDataDigest[];
+ color?: string;
+ lastUpdated: string;
+ timelineOwnerV2: string;
+ timelineNameV2: string;
+ editable: boolean;
+}
+
+export type HttpTimelineGenericPostInfo =
+ | HttpTimelinePostInfo
+ | HttpTimelineDeletedPostInfo;
+
export interface HttpTimelinePostPostRequestData {
contentType: string;
data: string;
@@ -116,7 +134,7 @@ export interface IHttpTimelineClient {
listPost(
ownerUsername: string,
timelineName: string
- ): Promise<Page<HttpTimelinePostInfo>>;
+ ): Promise<Page<HttpTimelineGenericPostInfo>>;
generatePostDataUrl(
ownerUsername: string,
timelineName: string,
@@ -218,9 +236,9 @@ export class HttpTimelineClient implements IHttpTimelineClient {
listPost(
ownerUsername: string,
timelineName: string
- ): Promise<Page<HttpTimelinePostInfo>> {
+ ): Promise<Page<HttpTimelineGenericPostInfo>> {
return axios
- .get<Page<HttpTimelinePostInfo>>(
+ .get<Page<HttpTimelineGenericPostInfo>>(
`${apiBaseUrl}/v2/timelines/${ownerUsername}/${timelineName}/posts`
)
.then(extractResponseData);