feat: add API optimizations, cache invalidation and comprehensive test suite
- Add abort controllers and request deduplication to composables - Add entity type cache invalidation on create/update/delete flows - Add 179 new tests (utilities, services, composables, components) - Fix Vue runtime warnings in structure editors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1198,6 +1198,11 @@ export function useMachineDetailData(machineId: string) {
|
||||
syncMachineCustomFields()
|
||||
initMachineFields()
|
||||
|
||||
// Start document loading early (independent of products/links)
|
||||
const documentPromise = !machineDocumentsLoaded.value
|
||||
? refreshMachineDocuments()
|
||||
: Promise.resolve()
|
||||
|
||||
if (!(productInventory.value as AnyRecord[]).length) {
|
||||
try {
|
||||
await loadProducts()
|
||||
@@ -1228,9 +1233,8 @@ export function useMachineDetailData(machineId: string) {
|
||||
|
||||
collapseAllComponents()
|
||||
|
||||
if (!machineDocumentsLoaded.value) {
|
||||
await refreshMachineDocuments()
|
||||
}
|
||||
// Wait for documents if still loading
|
||||
await documentPromise
|
||||
} catch (error) {
|
||||
console.error('Erreur lors du chargement des données:', error)
|
||||
} finally {
|
||||
@@ -1238,10 +1242,12 @@ export function useMachineDetailData(machineId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
const loadInitialData = () => {
|
||||
if (!constructeurs.value.length) loadConstructeurs()
|
||||
if (!componentTypes.value.length) loadComponentTypes()
|
||||
if (!pieceTypes.value.length) loadPieceTypes()
|
||||
const loadInitialData = (): Promise<unknown[]> => {
|
||||
return Promise.all([
|
||||
loadConstructeurs(),
|
||||
loadComponentTypes(),
|
||||
loadPieceTypes(),
|
||||
])
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user