chore: build
Backend - Build & Lint / build (push) Failing after 16m27s
Frontend Admin - EAS Build / build (push) Failing after 2h15m57s

This commit is contained in:
Nuxgrid
2026-07-15 20:55:46 +02:00
parent e5333395b9
commit 74bf9cf14c
7 changed files with 400 additions and 1 deletions
+44
View File
@@ -416,6 +416,50 @@ export const getLivreurRatings = async (
}
};
export interface LoginHistoryEntry {
id: number;
username: string;
created_at: string;
}
export interface LoginHistoryWeek {
week: number;
entries: LoginHistoryEntry[];
}
export const getLivreurLoginHistory = async (
username: string,
year?: number,
month?: number,
): Promise<{
success: boolean;
year: number;
month: number;
weeks: LoginHistoryWeek[];
count: number;
}> => {
try {
const { data } = await apiClient.get(
`${V2}/admin/protected/delivery-persons/${username}/login-history`,
{ params: { year, month } },
);
return {
success: true,
year: data.year,
month: data.month,
weeks: data.weeks || [],
count: data.count || 0,
};
} catch {
return {
success: false,
year: year ?? new Date().getFullYear(),
month: month ?? new Date().getMonth() + 1,
weeks: [],
count: 0,
};
}
};
const parseStatus = (status: any): "available" | "busy" | "offline" => {
if (!status) return "offline";
if (status === "available" || status === "busy" || status === "offline")