CHANGE: updated to correct sql database
This commit is contained in:
@@ -24,7 +24,7 @@ func main() {
|
||||
http.HandleFunc("/time/new", timeCreateHandler)
|
||||
http.HandleFunc("/time", timeHandler)
|
||||
|
||||
fmt.Printf("Server is running at http://localhost:8080 exposed to port %s\n", getEnv("EXPOSED_PORT", "8000"))
|
||||
fmt.Printf("Server is running at http://localhost:8000 exposed to port %s\n", getEnv("EXPOSED_PORT", "8000"))
|
||||
log.Fatal(http.ListenAndServe(":8000", nil))
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ func createBooking(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func getBookings(w http.ResponseWriter, r *http.Request) {
|
||||
card_id := r.URL.Query().Get("cardID")
|
||||
card_id := r.URL.Query().Get("card_uid")
|
||||
if card_id == "" {
|
||||
http.Error(w, "Missing cardID query parameter", http.StatusBadRequest)
|
||||
return
|
||||
@@ -92,7 +92,7 @@ func getBookings(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
_booking_id := r.URL.Query().Get("bookingID")
|
||||
_booking_id := r.URL.Query().Get("counter_id")
|
||||
if _booking_id == "" {
|
||||
http.Error(w, "Missing bookingID query parameter", http.StatusBadRequest)
|
||||
return
|
||||
@@ -117,7 +117,7 @@ func updateBooking(w http.ResponseWriter, r *http.Request) {
|
||||
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
if booking.Id != 0 && booking.Id != _booking.Id {
|
||||
if booking.CounterId != 0 && booking.CounterId != _booking.CounterId {
|
||||
log.Println("Booking Ids do not match")
|
||||
http.Error(w, "Booking Ids do not match", http.StatusBadRequest)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user