front driver availabilities
This commit is contained in:
@@ -25,6 +25,7 @@ type Booking struct {
|
||||
bookingData solidarity_service.CreateBookingSolidarityRequest
|
||||
}
|
||||
|
||||
//List les conducteurs disponibles + Créer une réservation
|
||||
func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
if r.Method == "GET" && r.FormValue("date") != ""{
|
||||
@@ -130,21 +131,8 @@ func (h *ApplicationHandler) DriversJourney(w http.ResponseWriter, r *http.Reque
|
||||
|
||||
}else {
|
||||
|
||||
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)
|
||||
h.Renderer.CreateBookingHome(w, r)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user