mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2024-11-23 22:09:22 +00:00
17 lines
510 B
Rust
17 lines
510 B
Rust
|
//! # Friends controller
|
||
|
//!
|
||
|
//! @author Pierre Hubert
|
||
|
|
||
|
use crate::api_data::friend_api::FriendAPI;
|
||
|
use crate::controllers::routes::RequestResult;
|
||
|
use crate::data::http_request_handler::HttpRequestHandler;
|
||
|
use crate::helpers::friends_helper;
|
||
|
|
||
|
/// Get the list of friends of the current user
|
||
|
pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult {
|
||
|
let list = friends_helper::get_list(&r.user_id()?)?;
|
||
|
|
||
|
// TODO : update last activity (if allowed)
|
||
|
|
||
|
r.set_response(FriendAPI::from_list(&list))
|
||
|
}
|