Get single accommodation information
This commit is contained in:
parent
49f3677081
commit
9a4da0462a
@ -72,6 +72,11 @@ pub async fn get_full_list(m: FamilyInPath) -> HttpResult {
|
|||||||
.json(accommodations_list_service::get_all_of_family(m.family_id()).await?))
|
.json(accommodations_list_service::get_all_of_family(m.family_id()).await?))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the information of a single accommodation
|
||||||
|
pub async fn get_single(m: FamilyAndAccommodationInPath) -> HttpResult {
|
||||||
|
Ok(HttpResponse::Ok().json(&m.to_accommodation()))
|
||||||
|
}
|
||||||
|
|
||||||
/// Delete an accommodation
|
/// Delete an accommodation
|
||||||
pub async fn delete(
|
pub async fn delete(
|
||||||
m: FamilyAndAccommodationInPath,
|
m: FamilyAndAccommodationInPath,
|
||||||
|
@ -214,12 +214,15 @@ async fn main() -> std::io::Result<()> {
|
|||||||
"/family/{id}/accommodations/list/list",
|
"/family/{id}/accommodations/list/list",
|
||||||
web::get().to(accommodations_list_controller::get_full_list),
|
web::get().to(accommodations_list_controller::get_full_list),
|
||||||
)
|
)
|
||||||
|
.route(
|
||||||
|
"/family/{id}/accommodations/list/{accommodation_id}",
|
||||||
|
web::get().to(accommodations_list_controller::get_single),
|
||||||
|
)
|
||||||
|
// TODO : update
|
||||||
.route(
|
.route(
|
||||||
"/family/{id}/accommodations/list/{accommodation_id}",
|
"/family/{id}/accommodations/list/{accommodation_id}",
|
||||||
web::delete().to(accommodations_list_controller::delete),
|
web::delete().to(accommodations_list_controller::delete),
|
||||||
)
|
)
|
||||||
// TODO : get single
|
|
||||||
// TODO : update
|
|
||||||
// [ACCOMODATIONS] Reservations controller
|
// [ACCOMODATIONS] Reservations controller
|
||||||
// TODO : create
|
// TODO : create
|
||||||
// TODO : update
|
// TODO : update
|
||||||
|
Loading…
Reference in New Issue
Block a user