edit exports/fleets

This commit is contained in:
Nicolas CARON 2023-06-01 10:59:21 +02:00
parent b0dd81bf67
commit 4fe479c1fb
1 changed files with 27 additions and 2 deletions

View File

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