mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-17 20:30:07 +02:00
fix: extractList includes API-specific wrapper keys, diag uses real codefou
- extractList now explicitly checks "mouvements", "articles", "fournisseurs", "ventes", "stocks", "commandes" wrapper keys before generic array fallback - Diag endpoint auto-fetches first real codefou from fournisseurs instead of hardcoded "AUXENCE" (which was supplier nom, not actual codefou) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e500b6650
commit
c33e22f7eb
2 files changed
+13
-2
No files matched your search
@@ -85,7 +85,7 @@ function extractList(data: unknown): any[] {
|
||||
if (Array.isArray(data)) return data;
|
||||
const d = data as Record<string, unknown>;
|
||||
// Essaie les wrappers courants
|
||||
for (const key of ["items", "data", "result", "results", "records", "list"]) {
|
||||
for (const key of ["items", "data", "result", "results", "records", "list", "mouvements", "articles", "fournisseurs", "ventes", "stocks", "commandes"]) {
|
||||
if (Array.isArray(d[key])) return d[key] as unknown[];
|
||||
}
|
||||
// Cherche la première propriété qui est un tableau
|
||||
|
||||
Reference in new issue
Block a user