chore: update

This commit is contained in:
2026-06-12 16:11:41 +02:00
parent 370b1a5742
commit d18052e749
6 changed files with 321 additions and 72 deletions
+22
View File
@@ -372,6 +372,28 @@ export const ISSUE_LABELS: Record<IssueType, string> = {
other: "Autre",
};
export type StatPoint = { label: string; count: number; revenue: number };
export const getMyStats = async (): Promise<{
success: boolean;
by_day?: StatPoint[];
by_week?: StatPoint[];
by_month?: StatPoint[];
error?: string;
}> => {
try {
const { data } = await apiClient.get(`${API}/stats`);
return {
success: true,
by_day: data.by_day || [],
by_week: data.by_week || [],
by_month: data.by_month || [],
};
} catch (error: any) {
return { success: false, error: error.response?.data?.error || "Erreur réseau" };
}
};
export const reportDeliveryIssue = async (
deliveryId: number,
issueType: IssueType,