rename lots of things

This commit is contained in:
folex
2019-08-16 12:00:50 +03:00
parent 9dd2a2d9c8
commit 50747bbcd3
47 changed files with 31 additions and 227 deletions

View File

@ -51,7 +51,7 @@ fn fetch_posts(username: Option<String>) -> AppResult<Response> {
// Get all posts if no filter username was passed
None => model::get_all_posts()?,
// Or get only posts from specified author
Some(h) => model::get_posts_by_handle(h)?,
Some(h) => model::get_posts_by_username(h)?,
};
// Some Rust-specific detail to play nice with serialization, doesn't matter

View File

@ -34,7 +34,7 @@ pub fn get_all_posts() -> AppResult<String> {
.map_err(|e| err_msg(&format!("Error retrieving posts: {}", e)))
}
pub fn get_posts_by_handle(username: String) -> AppResult<String> {
pub fn get_posts_by_username(username: String) -> AppResult<String> {
database::query(format!(
"SELECT json_group_array(
json_object('msg', msg, 'username', username)