MMS43 changes
This commit is contained in:
@@ -24,12 +24,12 @@ import (
|
||||
)
|
||||
|
||||
type DashboardResult struct {
|
||||
Accounts []mobilityaccountsstorage.Account
|
||||
Members []mobilityaccountsstorage.Account
|
||||
Events []agendastorage.Event
|
||||
Bookings []fleetstorage.Booking
|
||||
SolidarityDrivers []mobilityaccountsstorage.Account
|
||||
OrganizedCarpoolDrivers []mobilityaccountsstorage.Account
|
||||
Accounts []mobilityaccountsstorage.Account
|
||||
Members []mobilityaccountsstorage.Account
|
||||
Events []agendastorage.Event
|
||||
Bookings []fleetstorage.Booking
|
||||
SolidarityDrivers []mobilityaccountsstorage.Account
|
||||
OrganizedCarpoolDrivers []mobilityaccountsstorage.Account
|
||||
}
|
||||
|
||||
func (h *ApplicationHandler) GetDashboardData(ctx context.Context, driverAddressGeoLayer, driverAddressGeoCode string) (*DashboardResult, error) {
|
||||
@@ -62,14 +62,7 @@ func (h *ApplicationHandler) GetDashboardData(ctx context.Context, driverAddress
|
||||
|
||||
accounts := []mobilityaccountsstorage.Account{}
|
||||
|
||||
// We only display the 5 most recent here
|
||||
count := len(resp.Accounts)
|
||||
min := count - 5
|
||||
if min < 0 {
|
||||
min = 0
|
||||
}
|
||||
|
||||
for _, account := range resp.Accounts[min:] {
|
||||
for _, account := range resp.Accounts {
|
||||
// Check if not archived
|
||||
if archived, ok := account.Data.AsMap()["archived"].(bool); !ok || !archived {
|
||||
a := account.ToStorageType()
|
||||
@@ -225,4 +218,3 @@ func (h *ApplicationHandler) GetDashboardData(ctx context.Context, driverAddress
|
||||
OrganizedCarpoolDrivers: organizedCarpoolDrivers,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user