summaryrefslogtreecommitdiffstats
path: root/server/src/api/post.rs
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2020-01-31 20:02:20 -0500
committerDessalines <tyhou13@gmx.com>2020-01-31 20:02:20 -0500
commit8036474ddad2f20c27a2fb023395306d6b9e577d (patch)
tree28f3546c9086931f33d9ee6d910c9aa43a5a1f77 /server/src/api/post.rs
parent5188bddd4ddb1d4f4bc4add24db210789054c2a5 (diff)
Starting to work on user message scope.
Diffstat (limited to 'server/src/api/post.rs')
-rw-r--r--server/src/api/post.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/server/src/api/post.rs b/server/src/api/post.rs
index 3f211453..642521eb 100644
--- a/server/src/api/post.rs
+++ b/server/src/api/post.rs
@@ -8,7 +8,7 @@ pub struct CreatePost {
url: Option<String>,
body: Option<String>,
nsfw: bool,
- community_id: i32,
+ pub community_id: i32,
auth: String,
}
@@ -30,6 +30,7 @@ pub struct GetPostResponse {
community: CommunityView,
moderators: Vec<CommunityModeratorView>,
admins: Vec<UserView>,
+ pub online: usize,
}
#[derive(Serialize, Deserialize)]
@@ -38,7 +39,7 @@ pub struct GetPosts {
sort: String,
page: Option<i64>,
limit: Option<i64>,
- community_id: Option<i32>,
+ pub community_id: Option<i32>,
auth: Option<String>,
}
@@ -54,9 +55,9 @@ pub struct CreatePostLike {
auth: String,
}
-#[derive(Serialize, Deserialize)]
+#[derive(Serialize, Deserialize, Clone)]
pub struct CreatePostLikeResponse {
- post: PostView,
+ pub post: PostView,
}
#[derive(Serialize, Deserialize)]
@@ -193,6 +194,7 @@ impl Perform<GetPostResponse> for Oper<GetPost> {
community,
moderators,
admins,
+ online: 0,
})
}
}