edit handlers vehicle-management for unbooking a vehicle
This commit is contained in:
@@ -494,6 +494,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
|
||||
func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
bookingid := vars["bookingid"]
|
||||
|
||||
request := &fleets.GetBookingRequest{
|
||||
Bookingid: bookingid,
|
||||
}
|
||||
@@ -515,7 +516,7 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
|
||||
Startdate: resp.Booking.Startdate,
|
||||
Enddate: resp.Booking.Enddate,
|
||||
Unavailablefrom: resp.Booking.Unavailablefrom,
|
||||
Unavailableto: resp.Booking.Unavailableto,
|
||||
Unavailableto: timestamppb.New(time.Now().Add(-48 * time.Hour)),
|
||||
Data: resp.Booking.Data,
|
||||
Deleted: true,
|
||||
},
|
||||
@@ -532,5 +533,5 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
|
||||
http.Redirect(w, r, "/app/vehicles-management/", http.StatusFound)
|
||||
return
|
||||
}
|
||||
h.Renderer.UnbookingVehicle(w, r, bookingid)
|
||||
h.Renderer.UnbookingVehicle(w, r, resp.Booking.ToStorageType())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user