feat: add constructors selection and management
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user