This commit is contained in:
soukainna 2023-02-22 12:22:49 +01:00
parent f023a7bbff
commit 167e8cfe2e
1 changed files with 12 additions and 12 deletions

View File

@ -52,14 +52,14 @@ func (h *ApplicationHandler) VehiclesManagementOverview(w http.ResponseWriter, r
} }
} }
vehiicles := []fleetsstorage.Vehicle{} // vehiicles := []fleetsstorage.Vehicle{}
for i, vehiicle := range resp.Vehicles { // for i, vehiicle := range resp.Vehicles {
if len(resp.Vehicles[i].Bookings) == 0 { // if len(resp.Vehicles[i].Bookings) == 0 {
v := vehiicle.ToStorageType() // v := vehiicle.ToStorageType()
vehiicles = append(vehiicles, v) // vehiicles = append(vehiicles, v)
} // }
} // }
fmt.Println(vehiicles) //fmt.Println(vehiicles)
sort.Sort(sorting.VehiclesByLicencePlate(vehicles)) sort.Sort(sorting.VehiclesByLicencePlate(vehicles))
sort.Sort(sorting.BookingsByStartdate(bookings)) sort.Sort(sorting.BookingsByStartdate(bookings))
h.Renderer.VehiclesManagementOverview(w, r, vehicles, vehicles_map, 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) w.WriteHeader(http.StatusInternalServerError)
return return
} }
if len(resp.Vehicle.ToStorageType().Bookings) == 0 { // if len(resp.Vehicle.ToStorageType().Bookings) == 0 {
fmt.Println("lol") // fmt.Println("lol")
} // }
fmt.Println(resp.Vehicle.ToStorageType().Bookings) // fmt.Println(resp.Vehicle.ToStorageType().Bookings)
h.Renderer.VehiclesFleetDisplay(w, r, resp.Vehicle.ToStorageType()) h.Renderer.VehiclesFleetDisplay(w, r, resp.Vehicle.ToStorageType())
} }