Add /family/{id}/users route

This commit is contained in:
2023-06-21 17:01:52 +02:00
parent 381a4797e4
commit ad54f83c2c
5 changed files with 48 additions and 8 deletions

View File

@ -78,3 +78,8 @@ pub async fn single_info(f: FamilyInPath) -> HttpResult {
Ok(HttpResponse::Ok()
.json(families_service::get_family_membership(f.family_id(), f.user_id()).await?))
}
/// Get the list of users who belongs to a family
pub async fn users(f: FamilyInPath) -> HttpResult {
Ok(HttpResponse::Ok().json(families_service::get_memberships_of_family(f.family_id()).await?))
}