1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-12-28 14:38:52 +00:00

Ready to implement new route

This commit is contained in:
Pierre HUBERT 2020-06-12 08:50:09 +02:00
parent 620328b33b
commit bfd7cc0630
2 changed files with 8 additions and 1 deletions

View File

@ -48,8 +48,12 @@ pub fn create(r: &mut HttpRequestHandler) -> RequestResult {
/// Get the list of conversations of a user
pub fn get_list(r: &mut HttpRequestHandler) -> RequestResult {
let list = conversations_helper::get_list_user(r.user_id()?)?;
r.set_response(list.iter().map(|c| ConversationAPI::new(c)).collect::<Vec<ConversationAPI>>())
}
/// Get information about a single conversation
pub fn get_single(r: &mut HttpRequestHandler) -> RequestResult {
r.success("Implement id")
}

View File

@ -93,6 +93,9 @@ pub fn get_routes() -> Vec<Route> {
Route::post("/conversations/getList", Box::new(conversations_controller::get_list)),
Route::post("/conversations/getInfoOne", Box::new(conversations_controller::get_single)),
Route::post("/conversations/getInfosOne", Box::new(conversations_controller::get_single)),
// Virtual directory controller
Route::post("/user/findbyfolder", Box::new(virtual_directory_controller::find_user)),