diff --git a/handlers/exports/fleets.go b/handlers/exports/fleets.go index 381f4e2..d4ac2c0 100644 --- a/handlers/exports/fleets.go +++ b/handlers/exports/fleets.go @@ -45,6 +45,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) { } + groups := map[string]groupsstorage.Group{} admingroups, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), &groupsmanagement.GetGroupsRequest{ @@ -106,14 +107,38 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) { bookedby := "" if v, ok := b.Data["booked_by"].(map[string]any); ok { - if v2, ok := v["group"].(map[string]any); ok { - if v3, ok := v2["name"].(string); ok { + if v2, ok := v["user"].(map[string]any); ok { + if v3, ok := v2["display_name"].(string); ok { bookedby = v3 } } } + bookedbygroup := "" + if v4, ok := b.Data["booked_by"].(map[string]any); ok { + if v5, ok := v4["group"].(map[string]any); ok { + if v6, ok := v5["id"].(string); ok { + bookedbygroup = v6 + } + } + } + fmt.Println("\n"+bookedbygroup+"\n") + + // for _, a := range vehicle.Administrators { + // if a == bookedbygroup { + // fmt.Println("\n"+a+"\n") + // } + // } + + // group := "" + + // fmt.Printf("\n"+group+"\n") + + // if bookedbygroup == group { + // continue + // } + beneficiary := beneficiaries_map[b.Driver] adminunavailability := false