From 167e8cfe2ef240e4b7a64dfa9575b3718b268dae Mon Sep 17 00:00:00 2001 From: soukainna Date: Wed, 22 Feb 2023 12:22:49 +0100 Subject: [PATCH] fix err --- handlers/application/vehicles-management.go | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/handlers/application/vehicles-management.go b/handlers/application/vehicles-management.go index e91bb66..29201ad 100644 --- a/handlers/application/vehicles-management.go +++ b/handlers/application/vehicles-management.go @@ -52,14 +52,14 @@ func (h *ApplicationHandler) VehiclesManagementOverview(w http.ResponseWriter, r } } - vehiicles := []fleetsstorage.Vehicle{} - for i, vehiicle := range resp.Vehicles { - if len(resp.Vehicles[i].Bookings) == 0 { - v := vehiicle.ToStorageType() - vehiicles = append(vehiicles, v) - } - } - fmt.Println(vehiicles) + // vehiicles := []fleetsstorage.Vehicle{} + // for i, vehiicle := range resp.Vehicles { + // if len(resp.Vehicles[i].Bookings) == 0 { + // v := vehiicle.ToStorageType() + // vehiicles = append(vehiicles, v) + // } + // } + //fmt.Println(vehiicles) sort.Sort(sorting.VehiclesByLicencePlate(vehicles)) sort.Sort(sorting.BookingsByStartdate(bookings)) h.Renderer.VehiclesManagementOverview(w, r, vehicles, vehicles_map, bookings) @@ -190,10 +190,10 @@ func (h *ApplicationHandler) VehiclesFleetDisplay(w http.ResponseWriter, r *http w.WriteHeader(http.StatusInternalServerError) return } - if len(resp.Vehicle.ToStorageType().Bookings) == 0 { - fmt.Println("lol") - } - fmt.Println(resp.Vehicle.ToStorageType().Bookings) + // if len(resp.Vehicle.ToStorageType().Bookings) == 0 { + // fmt.Println("lol") + // } + // fmt.Println(resp.Vehicle.ToStorageType().Bookings) h.Renderer.VehiclesFleetDisplay(w, r, resp.Vehicle.ToStorageType()) }