edit exports/fleets
This commit is contained in:
parent
b0dd81bf67
commit
4fe479c1fb
|
@ -45,6 +45,7 @@ func (h *ExportsHandler) Bookings(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
groups := map[string]groupsstorage.Group{}
|
groups := map[string]groupsstorage.Group{}
|
||||||
|
|
||||||
admingroups, err := h.services.GRPC.GroupsManagement.GetGroups(context.TODO(), &groupsmanagement.GetGroupsRequest{
|
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 := ""
|
bookedby := ""
|
||||||
if v, ok := b.Data["booked_by"].(map[string]any); ok {
|
if v, ok := b.Data["booked_by"].(map[string]any); ok {
|
||||||
if v2, ok := v["group"].(map[string]any); ok {
|
if v2, ok := v["user"].(map[string]any); ok {
|
||||||
if v3, ok := v2["name"].(string); ok {
|
if v3, ok := v2["display_name"].(string); ok {
|
||||||
bookedby = v3
|
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]
|
beneficiary := beneficiaries_map[b.Driver]
|
||||||
adminunavailability := false
|
adminunavailability := false
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue