MMS43 changes

This commit is contained in:
Arnaud Delcasse
2025-12-29 10:50:58 +01:00
parent 52de8d363e
commit 6cda7509c1
6 changed files with 126 additions and 79 deletions

View File

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