Add GET /family/{id}/members
This commit is contained in:
@ -242,6 +242,12 @@ pub async fn create(f: FamilyInPath, req: web::Json<MemberRequest>) -> HttpResul
|
||||
Ok(HttpResponse::Ok().json(member))
|
||||
}
|
||||
|
||||
/// Get the entire list of members of the family
|
||||
pub async fn get_all(f: FamilyInPath) -> HttpResult {
|
||||
let members = members_service::get_all_of_family(f.family_id()).await?;
|
||||
Ok(HttpResponse::Ok().json(members))
|
||||
}
|
||||
|
||||
/// Get the information of a single family member
|
||||
pub async fn get_single(m: FamilyAndMemberInPath) -> HttpResult {
|
||||
Ok(HttpResponse::Ok().json(m.to_member()))
|
||||
|
Reference in New Issue
Block a user