chore: build
Backend - Build & Lint / build (push) Successful in 32m22s
Frontend Admin - EAS Build / build (push) Successful in 1h39m14s

This commit is contained in:
Cameron Foussard
2026-11-03 09:12:36 +01:00
parent 0a18460f13
commit ae89d995d2
5 changed files with 98 additions and 15 deletions
@@ -18,6 +18,7 @@ import { useAuth } from "../../auth/AuthContext";
import {
getAllCommands,
getAllClients,
getAllUsers,
getAvailableDeliveryPersons,
getCommandCountByStatus,
getAdminTelegramStatus,
@@ -46,15 +47,22 @@ export default function DashboardScreen() {
const loadStats = useCallback(async () => {
try {
const [allCmd, pending, enRoute, completed, clients, livreurs] =
const [allCmd, pending, enRoute, completed, userCounts, livreurs] =
await Promise.all([
getAllCommands().then((r) => r.count),
getCommandCountByStatus("pending"),
getCommandCountByStatus("en_route"),
getCommandCountByStatus("approved"),
getAllClients(0, 1)
.then((r) => r.total)
.catch(() => 0),
// Totaux globaux (toute la base) : on ne charge qu'1 user,
// seuls les compteurs nous intéressent.
getAllUsers(0, 1)
.then(async (r) => ({
all: r.counts?.all ?? r.total,
client:
r.counts?.client ??
(await getAllClients(0, 1)).total,
}))
.catch(() => ({ all: 0, client: 0 })),
getAvailableDeliveryPersons()
.then((r) => r.count)
.catch(() => 0),
@@ -85,9 +93,15 @@ export default function DashboardScreen() {
icon: "checkmark-circle-outline",
color: colors.success,
},
{
label: "Utilisateurs",
value: userCounts.all,
icon: "person-outline",
color: colors.accent,
},
{
label: "Clients",
value: clients,
value: userCounts.client,
icon: "people-outline",
color: colors.accentLight,
},