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{}
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())
}