Add an accommodations reservations module #188
@ -27,6 +27,10 @@ pub async fn create_reservation(
|
|||||||
return Ok(HttpResponse::BadRequest().json("Start time is too far in the past!"));
|
return Ok(HttpResponse::BadRequest().json("Start time is too far in the past!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if req.start == req.end {
|
||||||
|
return Ok(HttpResponse::BadRequest().json("Start and end time must be different!"));
|
||||||
|
}
|
||||||
|
|
||||||
if req.start > req.end {
|
if req.start > req.end {
|
||||||
return Ok(HttpResponse::BadRequest().json("End time happens before start time!"));
|
return Ok(HttpResponse::BadRequest().json("End time happens before start time!"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user