refactor : merge Inventory_frontend submodule into frontend/ directory

Merges the full git history of Inventory_frontend into the monorepo
under frontend/. Removes the submodule in favor of a unified repo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-04-01 14:17:57 +02:00
226 changed files with 56920 additions and 4 deletions

View File

@@ -0,0 +1,16 @@
/**
* Shared API response helpers.
*
* Extracted from 10+ composables/components that each had an identical local
* copy of extractCollection (parsing hydra:member / member / data / array).
*/
export function extractCollection<T = any>(payload: unknown): T[] {
if (Array.isArray(payload)) return payload as T[]
const p = payload as Record<string, unknown> | null
if (Array.isArray(p?.member)) return p!.member as T[]
if (Array.isArray(p?.['hydra:member'])) return p!['hydra:member'] as T[]
if (Array.isArray(p?.items)) return p!.items as T[]
if (Array.isArray(p?.data)) return p!.data as T[]
return []
}