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