list all bookings
This commit is contained in:
@@ -128,17 +128,33 @@ func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Reque
|
||||
|
||||
h.Renderer.SolidarityServiceBooking(w, r, booking)
|
||||
|
||||
}else {
|
||||
}else {
|
||||
|
||||
h.Renderer.SolidarityService(w, r)
|
||||
accounts, err := h.services.GRPC.SolidarityService.GetAllPassengers(context.TODO(), &emptypb.Empty{})
|
||||
drivers, err := h.services.GRPC.SolidarityService.GetAllDrivers(context.TODO(), &emptypb.Empty{})
|
||||
bookings, err := h.services.GRPC.SolidarityService.GetAllBookingsSolidarity(context.TODO(), &emptypb.Empty{})
|
||||
|
||||
|
||||
parcourmobAccounts, err := h.beneficiaries(r)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
}
|
||||
cacheid := uuid.NewString()
|
||||
h.cache.PutWithTTL(cacheid, accounts, 1*time.Hour)
|
||||
|
||||
|
||||
h.Renderer.SolidarityService(w, r, accounts, drivers, parcourmobAccounts, bookings, cacheid)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) SolidarityService (w http.ResponseWriter, r *http.Request) {
|
||||
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{})
|
||||
bookings, err := h.services.GRPC.SolidarityService.GetAllBookingsSolidarity(context.TODO(), &emptypb.Empty{})
|
||||
|
||||
|
||||
parcourmobAccounts, err := h.beneficiaries(r)
|
||||
if err != nil {
|
||||
@@ -148,10 +164,10 @@ 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, drivers, parcourmobAccounts, cacheid)
|
||||
h.Renderer.SolidarityService(w, r, accounts, drivers, parcourmobAccounts, bookings ,cacheid)
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) CreateDriver (w http.ResponseWriter, r *http.Request) {
|
||||
func (h *ApplicationHandler) CreateDriver(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if r.Method== "POST" {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user