Search community by name
Browse files at this commitaa1a10f75b393c0539dab1c4f04dd48a7196ba0dParent: e86062e- feat
- search community by name
1 changed file +11 -0
- crates/server/src/request.rs +11 -0
crates/server/src/request.rsmodified+11 -0
| @@ -230,6 +230,17 @@ pub async fn handle_request( | ||
| 230 | 230 | .collect(), |
| 231 | 231 | )) |
| 232 | 232 | } |
| 233 | + Request::SearchCommunity(search_community) => { | |
| 234 | + let communities = Community::read_by_name( | |
| 235 | + search_community.get_community_name(), | |
| 236 | + database_connection, | |
| 237 | + ) | |
| 238 | + .await?; | |
| 239 | + | |
| 240 | + Ok(Response::SearchCommunity( | |
| 241 | + communities.into_iter().map(Into::into).collect(), | |
| 242 | + )) | |
| 243 | + } | |
| 233 | 244 | } |
| 234 | 245 | }; |
| 235 | 246 |