edit handlers vehicle-management for unbooking a vehicle
This commit is contained in:
parent
31e5eadc73
commit
bfd14d7f4c
2
go.mod
2
go.mod
|
@ -6,7 +6,7 @@ go 1.18
|
||||||
|
|
||||||
// replace git.coopgo.io/coopgo-platform/groups-management => ../../coopgo-platform/groups-management/
|
// replace git.coopgo.io/coopgo-platform/groups-management => ../../coopgo-platform/groups-management/
|
||||||
|
|
||||||
// replace git.coopgo.io/coopgo-platform/fleets => ../../coopgo-platform/fleets/
|
replace git.coopgo.io/coopgo-platform/fleets => ../../coopgo-platform/fleets/
|
||||||
|
|
||||||
// replace git.coopgo.io/coopgo-platform/agenda => ../../coopgo-platform/agenda/
|
// replace git.coopgo.io/coopgo-platform/agenda => ../../coopgo-platform/agenda/
|
||||||
|
|
||||||
|
|
|
@ -494,6 +494,7 @@ func (h ApplicationHandler) VehiclesFleetMakeUnavailable(w http.ResponseWriter,
|
||||||
func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Request) {
|
func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Request) {
|
||||||
vars := mux.Vars(r)
|
vars := mux.Vars(r)
|
||||||
bookingid := vars["bookingid"]
|
bookingid := vars["bookingid"]
|
||||||
|
|
||||||
request := &fleets.GetBookingRequest{
|
request := &fleets.GetBookingRequest{
|
||||||
Bookingid: bookingid,
|
Bookingid: bookingid,
|
||||||
}
|
}
|
||||||
|
@ -515,7 +516,7 @@ func (h *ApplicationHandler) UnbookingVehicle(w http.ResponseWriter, r *http.Req
|
||||||
Startdate: resp.Booking.Startdate,
|
Startdate: resp.Booking.Startdate,
|
||||||
Enddate: resp.Booking.Enddate,
|
Enddate: resp.Booking.Enddate,
|
||||||
Unavailablefrom: resp.Booking.Unavailablefrom,
|
Unavailablefrom: resp.Booking.Unavailablefrom,
|
||||||
Unavailableto: resp.Booking.Unavailableto,
|
Unavailableto: timestamppb.New(time.Now().Add(-48 * time.Hour)),
|
||||||
Data: resp.Booking.Data,
|
Data: resp.Booking.Data,
|
||||||
Deleted: true,
|
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)
|
http.Redirect(w, r, "/app/vehicles-management/", http.StatusFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
h.Renderer.UnbookingVehicle(w, r, bookingid)
|
h.Renderer.UnbookingVehicle(w, r, resp.Booking.ToStorageType())
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ func (renderer *Renderer) VehicleManagementBookingDisplay(w http.ResponseWriter,
|
||||||
renderer.Render("vehicles search", w, r, files, state)
|
renderer.Render("vehicles search", w, r, files, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (renderer *Renderer) UnbookingVehicle(w http.ResponseWriter, r *http.Request, booking string) {
|
func (renderer *Renderer) UnbookingVehicle(w http.ResponseWriter, r *http.Request, booking any) {
|
||||||
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.delete_booking.files")
|
files := renderer.ThemeConfig.GetStringSlice("views.vehicles_management.delete_booking.files")
|
||||||
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
state := NewState(r, renderer.ThemeConfig, vehiclesmanagementMenu)
|
||||||
state.ViewState = map[string]any{
|
state.ViewState = map[string]any{
|
||||||
|
|
Loading…
Reference in New Issue