diff options
author | Dessalines <happydooby@gmail.com> | 2019-04-02 23:49:32 -0700 |
---|---|---|
committer | Dessalines <happydooby@gmail.com> | 2019-04-02 23:49:32 -0700 |
commit | ba5c93c8da599c0697883b3bd1673a584660ea34 (patch) | |
tree | 26a8754f8ca377efeff8446c2f660ed3d4fdfd50 /ui/src/interfaces.ts | |
parent | d443b048860ea302cfec2c674ba0a9838afe2b28 (diff) |
Adding forum / community pages
- Adding main forum page. Fixes #11
- Adding view version for posts. #21
- Got rid of fedi user ids. Fixes #22
- Post sorting working. Fixes #24
Diffstat (limited to 'ui/src/interfaces.ts')
-rw-r--r-- | ui/src/interfaces.ts | 47 |
1 files changed, 44 insertions, 3 deletions
diff --git a/ui/src/interfaces.ts b/ui/src/interfaces.ts index 95ea5e09..56d860bd 100644 --- a/ui/src/interfaces.ts +++ b/ui/src/interfaces.ts @@ -1,5 +1,5 @@ export enum UserOperation { - Login, Register, CreateCommunity, CreatePost, ListCommunities, GetPost, GetCommunity, CreateComment, EditComment, CreateCommentLike + Login, Register, CreateCommunity, CreatePost, ListCommunities, GetPost, GetCommunity, CreateComment, EditComment, CreateCommentLike, GetPosts, CreatePostLike } export interface User { @@ -31,12 +31,21 @@ export interface ListCommunitiesResponse { } export interface Post { + user_id?: number; + my_vote?: number; id: number; name: string; url?: string; body?: string; - attributed_to: string; + creator_id: number; + creator_name: string; community_id: number; + community_name: string; + number_of_comments: number; + score: number; + upvotes: number; + downvotes: number; + hot_rank: number; published: string; updated?: string; } @@ -59,7 +68,7 @@ export interface PostResponse { export interface Comment { id: number; content: string; - attributed_to: string; + creator_id: number; post_id: number, parent_id?: number; published: string; @@ -95,6 +104,30 @@ export interface CreateCommentLikeResponse { comment: Comment; } +export interface GetPostsForm { + type_: string; + sort: string; + limit: number; + community_id?: number; + auth?: string; +} + +export interface GetPostsResponse { + op: string; + posts: Array<Post>; +} + +export interface CreatePostLikeForm { + post_id: number; + score: number; + auth?: string; +} + +export interface CreatePostLikeResponse { + op: string; + post: Post; +} + export interface LoginForm { username_or_email: string; password: string; @@ -107,6 +140,7 @@ export interface RegisterForm { password_verify: string; } + export interface LoginResponse { op: string; jwt: string; @@ -116,4 +150,11 @@ export enum CommentSortType { Hot, Top, New } +export enum ListingType { + All, Subscribed, Community +} + +export enum ListingSortType { + Hot, New, TopDay, TopWeek, TopMonth, TopYear, TopAll +} |