summaryrefslogtreecommitdiffstats
path: root/server/src/websocket_server/server.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/websocket_server/server.rs')
-rw-r--r--server/src/websocket_server/server.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/src/websocket_server/server.rs b/server/src/websocket_server/server.rs
index 42124d2d..137761ab 100644
--- a/server/src/websocket_server/server.rs
+++ b/server/src/websocket_server/server.rs
@@ -111,6 +111,8 @@ pub struct CommunityResponse {
#[derive(Serialize, Deserialize)]
pub struct ListCommunities {
+ sort: String,
+ limit: Option<i64>,
auth: Option<String>
}
@@ -675,7 +677,9 @@ impl Perform for ListCommunities {
None => None
};
- let communities: Vec<CommunityView> = CommunityView::list_all(&conn, user_id).unwrap();
+ let sort = SortType::from_str(&self.sort).expect("listing sort");
+
+ let communities: Vec<CommunityView> = CommunityView::list(&conn, user_id, sort, self.limit).unwrap();
// Return the jwt
serde_json::to_string(