fix err
This commit is contained in:
parent
f023a7bbff
commit
167e8cfe2e
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue