feat: add constructors selection and management

This commit is contained in:
Matthieu
2025-09-17 15:10:01 +02:00
parent 3c0c22ad0f
commit 0a95b90553
11 changed files with 635 additions and 53 deletions

View File

@@ -78,11 +78,12 @@ export function useComposants() {
try {
const result = await patch(`/composants/${id}`, composantData)
if (result.success) {
const updated = result.data
const index = composants.value.findIndex(comp => comp.id === id)
if (index !== -1) {
composants.value[index] = result.data
composants.value[index] = updated
}
showSuccess(`Composant "${composantData.name}" mis à jour avec succès`)
showSuccess(`Composant "${updated?.name || composantData.name || ''}" mis à jour avec succès`)
}
return result
} catch (error) {
@@ -131,4 +132,4 @@ export function useComposants() {
getComposants,
isLoading
}
}
}