From bc800e7cf6b138dd6a12c02a5cf405f4cdd7e15c Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Thu, 23 May 2024 21:34:28 +0200 Subject: [PATCH] Only an admin can delete an accommodation --- .../src/controllers/accommodations_list_controller.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/geneit_backend/src/controllers/accommodations_list_controller.rs b/geneit_backend/src/controllers/accommodations_list_controller.rs index 44ffe8b..d38ec79 100644 --- a/geneit_backend/src/controllers/accommodations_list_controller.rs +++ b/geneit_backend/src/controllers/accommodations_list_controller.rs @@ -67,7 +67,10 @@ pub async fn create( } /// Delete an accommodation -pub async fn delete(m: FamilyAndAccommodationInPath) -> HttpResult { +pub async fn delete( + m: FamilyAndAccommodationInPath, + _admin: FamilyInPathWithAdminMembership, +) -> HttpResult { accommodations_list_service::delete(&mut m.to_accommodation()).await?; Ok(HttpResponse::Ok().finish()) }