up list silvermobiBookings

This commit is contained in:
2024-09-26 17:42:18 +02:00
parent 0cfa78e938
commit efaa4f9f0d
2 changed files with 13 additions and 25 deletions

View File

@@ -345,16 +345,6 @@ func (h *ApplicationHandler) BeneficiaryDisplay(w http.ResponseWriter, r *http.R
func (h *ApplicationHandler) BeneficiarySolidarityDisplay(w http.ResponseWriter, r *http.Request) {
accounts, err := h.beneficiaries(r)
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusBadRequest)
return
}
sort.Sort(sorting.BeneficiariesByName(accounts))
vars := mux.Vars(r)
beneficiaryID := vars["beneficiaryid"]
@@ -379,18 +369,18 @@ func (h *ApplicationHandler) BeneficiarySolidarityDisplay(w http.ResponseWriter,
solidarity_bookings_list, err := h.services.GRPC.SolidarityService.GetBookingsByStatus(context.TODO(), solidarity_booking)
if err != nil {
var bookings []any
for _, o := range solidarity_bookings_list.Booking {
bookings = append(bookings, o)
}
if err != nil {
fmt.Println(err)
w.WriteHeader(http.StatusInternalServerError)
return
}
cacheid := uuid.NewString()
h.cache.PutWithTTL(cacheid, accounts, 1*time.Hour)
h.cache.PutWithTTL(cacheid, solidarity_bookings_list, 1*time.Hour)
h.Renderer.BeneficiarySolidarityDisplay(w, r ,accounts, accountssolidarity , solidarity_bookings_list, cacheid)
h.Renderer.BeneficiarySolidarityDisplay(w, r , accountssolidarity , bookings)
}