Can delete a couple information
This commit is contained in:
parent
ea84c45e8a
commit
3a219ff9e2
@ -144,3 +144,9 @@ pub async fn update(m: FamilyAndCoupleInPath, req: web::Json<CoupleRequest>) ->
|
|||||||
|
|
||||||
Ok(HttpResponse::Accepted().finish())
|
Ok(HttpResponse::Accepted().finish())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Delete a couple
|
||||||
|
pub async fn delete(m: FamilyAndCoupleInPath) -> HttpResult {
|
||||||
|
couples_service::delete(&mut m.to_couple()).await?;
|
||||||
|
Ok(HttpResponse::Ok().finish())
|
||||||
|
}
|
||||||
|
@ -179,6 +179,10 @@ async fn main() -> std::io::Result<()> {
|
|||||||
"/family/{id}/couple/{couple_id}",
|
"/family/{id}/couple/{couple_id}",
|
||||||
web::put().to(couples_controller::update),
|
web::put().to(couples_controller::update),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
"/family/{id}/couple/{couple_id}",
|
||||||
|
web::delete().to(couples_controller::delete),
|
||||||
|
)
|
||||||
// Photos controller
|
// Photos controller
|
||||||
.route(
|
.route(
|
||||||
"/photo/{id}",
|
"/photo/{id}",
|
||||||
|
Loading…
Reference in New Issue
Block a user