list drivers first_name + last_name

This commit is contained in:
2024-09-17 10:30:29 +02:00
parent c03fcb31d6
commit 66c2c31090
2 changed files with 9 additions and 38 deletions

View File

@@ -14,8 +14,8 @@ const solidarityserviceMenu = "solidarity_service"
type SolidarityListState struct {
Count int `json:"count"`
CacheId string `json:"cache_id"`
Beneficiaries []mobilityaccountsstorage.Account `json:"beneficiaries"`
CacheId string `json:"cache_id"`
Beneficiaries []mobilityaccountsstorage.Account `json:"beneficiaries"`
Drivers *solidarity_service.DriverJourneysResponse `json:"drivers"`
}
@@ -32,14 +32,13 @@ func (s SolidarityListState) JSONWithLimits(a int, b int) template.JS {
return s.JSON()
}
func (renderer *Renderer) SolidarityService(w http.ResponseWriter, r *http.Request, drivers *solidarity_service.DriverJourneysResponse, accounts []mobilityaccountsstorage.Account, cacheid string) {
func (renderer *Renderer) SolidarityService(w http.ResponseWriter, r *http.Request, accounts []mobilityaccountsstorage.Account, cacheid string) {
files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.list.files")
state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu)
state.ViewState = SolidarityListState {
Count: len(accounts),
Beneficiaries: accounts,
state.ViewState = BeneficiariesListState{
Count: len(accounts),
CacheId: cacheid,
Drivers: drivers,
Beneficiaries: accounts,
}
renderer.Render("solidarity_service", w, r, files, state)
@@ -55,7 +54,7 @@ func (renderer *Renderer) SolidarityServiceBooking(w http.ResponseWriter, r *htt
renderer.Render("solidarity_service", w, r, files, state)
}
func (renderer *Renderer) SolidarityServiceBookingListDrivers(w http.ResponseWriter, r *http.Request, drivers *solidarity_service.DriverJourneysResponse, accounts []mobilityaccountsstorage.Account, booking *solidarity_service.BookingSolidarityRequest, cacheid string) {
func (renderer *Renderer) SolidarityServiceListAvailableDrivers(w http.ResponseWriter, r *http.Request, drivers *solidarity_service.DriverJourneysResponse, accounts []mobilityaccountsstorage.Account, booking *solidarity_service.BookingSolidarityRequest, cacheid string) {
files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.list.files")
state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu)
state.ViewState = SolidarityListState {