Add DELETE /family/{id}/member/{id_member}
This commit is contained in:
parent
c6d9264d94
commit
aa351bfae9
@ -286,3 +286,9 @@ pub async fn update(m: FamilyAndMemberInPath, req: web::Json<MemberRequest>) ->
|
|||||||
|
|
||||||
Ok(HttpResponse::Accepted().finish())
|
Ok(HttpResponse::Accepted().finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Delete a member
|
||||||
|
pub async fn delete(m: FamilyAndMemberInPath) -> HttpResult {
|
||||||
|
members_service::delete(&m).await?;
|
||||||
|
Ok(HttpResponse::Ok().finish())
|
||||||
|
}
|
||||||
|
@ -139,6 +139,10 @@ async fn main() -> std::io::Result<()> {
|
|||||||
"/family/{id}/member/{member_id}",
|
"/family/{id}/member/{member_id}",
|
||||||
web::put().to(members_controller::update),
|
web::put().to(members_controller::update),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
"/family/{id}/member/{member_id}",
|
||||||
|
web::delete().to(members_controller::delete),
|
||||||
|
)
|
||||||
})
|
})
|
||||||
.bind(AppConfig::get().listen_address.as_str())?
|
.bind(AppConfig::get().listen_address.as_str())?
|
||||||
.run()
|
.run()
|
||||||
|
Loading…
Reference in New Issue
Block a user