front driver availabilities

This commit is contained in:
2024-12-18 15:05:58 +01:00
parent 50e939c455
commit 726584b0fb
4 changed files with 24 additions and 29 deletions

View File

@@ -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)
}
}