booking test
This commit is contained in:
parent
27c27fef15
commit
1d363e8f2a
@ -196,12 +196,10 @@ func (o *BookingController) Check() {
|
||||
"error": errors.New("invalid date format"),
|
||||
}
|
||||
} else {
|
||||
bks := &booking.Booking{} // create a new booking object
|
||||
isAvailable, err2 := bks.Check(id, date, &date2, 1) // check if the booking is available
|
||||
fmt.Println(isAvailable, err2)
|
||||
bks := &booking.Booking{} // create a new booking object
|
||||
code := 200
|
||||
err := ""
|
||||
if !isAvailable {
|
||||
if isAvailable, err2 := bks.Check(id, date, &date2, 1); !isAvailable {
|
||||
code = 409
|
||||
err = "booking not available"
|
||||
if err2 != nil {
|
||||
@ -210,7 +208,7 @@ func (o *BookingController) Check() {
|
||||
}
|
||||
o.Data["json"] = map[string]interface{}{
|
||||
"data": map[string]interface{}{
|
||||
"is_available": isAvailable,
|
||||
"is_available": true,
|
||||
},
|
||||
"code": code,
|
||||
"error": err,
|
||||
|
Loading…
Reference in New Issue
Block a user