Create booking done

This commit is contained in:
Maxime 2024-09-18 15:56:13 +02:00
parent 127a3c44bf
commit 13a34ad124
3 changed files with 11 additions and 13 deletions

View File

@ -100,24 +100,24 @@ func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Reque
return return
} }
h.Renderer.SolidarityServiceListAvailableDrivers(w, r, drivers, accounts, &bookingData, cacheid) h.Renderer.SolidarityServiceListAvailableDrivers(w, r, drivers, &bookingData, accounts, cacheid)
} else { } else {
h.Renderer.SolidarityService(w, r, accounts, cacheid) h.Renderer.SolidarityService(w, r, accounts, cacheid)
} }
if r.Method == "POST" { // if r.Method == "POST" {
booking, err := h.services.GRPC.SolidarityService.CreateBookingSolidarity(context.TODO(), &bookingData) // booking, err := h.services.GRPC.SolidarityService.CreateBookingSolidarity(context.TODO(), &bookingData)
if err != nil { // if err != nil {
fmt.Println(err) // fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError) // w.WriteHeader(http.StatusInternalServerError)
return // return
} // }
h.Renderer.SolidarityServiceBooking(w, r, booking ) // h.Renderer.SolidarityServiceBooking(w, r, booking )
} // }
} }

View File

@ -139,8 +139,6 @@ func main() {
//=================================silvermobi==================================== //=================================silvermobi====================================
application.HandleFunc("/solidarity_service/", applicationHandler.DriversJourney) application.HandleFunc("/solidarity_service/", applicationHandler.DriversJourney)
//application.HandleFunc("/solidarity_service/", applicationHandler.CreatePendingBooking)
appGroup := application.PathPrefix("/group_module").Subrouter() appGroup := application.PathPrefix("/group_module").Subrouter()
appGroup.HandleFunc("/", applicationHandler.Groups) appGroup.HandleFunc("/", applicationHandler.Groups)

View File

@ -54,7 +54,7 @@ func (renderer *Renderer) SolidarityServiceBooking(w http.ResponseWriter, r *htt
renderer.Render("solidarity_service", w, r, files, state) renderer.Render("solidarity_service", w, r, files, state)
} }
func (renderer *Renderer) SolidarityServiceListAvailableDrivers(w http.ResponseWriter, r *http.Request, drivers *solidarity_service.DriverJourneysResponse, accounts []mobilityaccountsstorage.Account, bookingData *solidarity_service.CreateBookingSolidarityRequest, cacheid string) { func (renderer *Renderer) SolidarityServiceListAvailableDrivers(w http.ResponseWriter, r *http.Request, drivers *solidarity_service.DriverJourneysResponse, booking *solidarity_service.CreateBookingSolidarityRequest, accounts []mobilityaccountsstorage.Account, cacheid string) {
files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.list.files") files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.list.files")
state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu) state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu)
state.ViewState = SolidarityListState { state.ViewState = SolidarityListState {