getAllDrivers
This commit is contained in:
parent
163ffefbfb
commit
f43d02c762
|
@ -133,6 +133,8 @@ func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Reque
|
|||
func (h *ApplicationHandler) SolidarityService (w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
accounts, err := h.services.GRPC.SolidarityService.GetAllPassengers(context.TODO(), &emptypb.Empty{})
|
||||
drivers, err := h.services.GRPC.SolidarityService.GetAllDrivers(context.TODO(), &emptypb.Empty{})
|
||||
|
||||
parcourmobAccounts, err := h.beneficiaries(r)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
|
@ -141,6 +143,5 @@ func (h *ApplicationHandler) SolidarityService (w http.ResponseWriter, r *http.R
|
|||
cacheid := uuid.NewString()
|
||||
h.cache.PutWithTTL(cacheid, accounts, 1*time.Hour)
|
||||
|
||||
|
||||
h.Renderer.BeneficiariesSolidarity(w, r, accounts, parcourmobAccounts, cacheid)
|
||||
h.Renderer.BeneficiariesSolidarity(w, r, accounts, drivers, parcourmobAccounts, cacheid)
|
||||
}
|
|
@ -5,8 +5,8 @@ import (
|
|||
"html/template"
|
||||
"net/http"
|
||||
|
||||
solidarity_service "git.coopgo.io/sbouaram/solidarity-service/servers/grpc/proto"
|
||||
mobilityaccountsstorage "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
|
||||
solidarity_service "git.coopgo.io/sbouaram/solidarity-service/servers/grpc/proto"
|
||||
)
|
||||
|
||||
const solidarityserviceMenu = "solidarity_service"
|
||||
|
@ -26,6 +26,7 @@ type BeneficiariesSolidarityListState struct {
|
|||
CacheId string `json:"cache_id"`
|
||||
BeneficiariesSolidarity *solidarity_service.GetAllPassengersResponse `json:"beneficiariessolidarity"`
|
||||
Beneficiaries []mobilityaccountsstorage.Account `json:"beneficiaries"`
|
||||
Drivers *solidarity_service.GetAllDriversResponse `json:"drivers"`
|
||||
|
||||
}
|
||||
|
||||
|
@ -34,7 +35,6 @@ type SolidarityBookingsState struct {
|
|||
Beneficiaries []mobilityaccountsstorage.Account `json:"beneficiaries"`
|
||||
BeneficiariesSolidarity *solidarity_service.GetAllPassengersResponse `json:"beneficiariessolidarity"`
|
||||
|
||||
|
||||
}
|
||||
|
||||
func (s BeneficiariesSolidarityListState) JSON() template.JS {
|
||||
|
@ -80,7 +80,7 @@ func (renderer *Renderer) SolidarityService(w http.ResponseWriter, r *http.Reque
|
|||
renderer.Render("solidarity_service", w, r, files, state)
|
||||
}
|
||||
|
||||
func (renderer *Renderer) BeneficiariesSolidarity(w http.ResponseWriter, r *http.Request, accounts *solidarity_service.GetAllPassengersResponse, parcourmobAccounts []mobilityaccountsstorage.Account, cacheid string) {
|
||||
func (renderer *Renderer) BeneficiariesSolidarity(w http.ResponseWriter, r *http.Request, accounts *solidarity_service.GetAllPassengersResponse, drivers *solidarity_service.GetAllDriversResponse, parcourmobAccounts []mobilityaccountsstorage.Account, cacheid string) {
|
||||
files := renderer.ThemeConfig.GetStringSlice("views.solidarity_service.list.files")
|
||||
state := NewState(r, renderer.ThemeConfig, solidarityserviceMenu)
|
||||
state.ViewState = BeneficiariesSolidarityListState{
|
||||
|
@ -88,6 +88,7 @@ func (renderer *Renderer) BeneficiariesSolidarity(w http.ResponseWriter, r *http
|
|||
CacheId: cacheid,
|
||||
Beneficiaries: parcourmobAccounts,
|
||||
BeneficiariesSolidarity: accounts,
|
||||
Drivers: drivers,
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue