1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2025-06-20 16:35:17 +00:00

Can get the list of memberships of a user

This commit is contained in:
2020-07-13 11:17:35 +02:00
parent 59961129c5
commit b5bcb3e8c7
10 changed files with 160 additions and 22 deletions

View File

@ -2,10 +2,14 @@
//!
//! @author Pierre Hubert
use crate::api_data::user_membership_api::UserMembershipAPI;
use crate::controllers::routes::RequestResult;
use crate::data::http_request_handler::HttpRequestHandler;
use crate::helpers::webapp_helper;
/// Get the list of memberships of a given user
pub fn get_memberships(r: &mut HttpRequestHandler) -> RequestResult {
r.success("Implement me")
let memberships = webapp_helper::get_user_memberships(r.user_id_ref()?)?;
r.set_response(UserMembershipAPI::for_list(&memberships))
}