fix(navigation) : use router.replace after entity creation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -344,7 +344,7 @@ export function useComponentCreate() {
|
|||||||
selectedDocuments.value = []
|
selectedDocuments.value = []
|
||||||
}
|
}
|
||||||
toast.showSuccess('Composant créé avec succès')
|
toast.showSuccess('Composant créé avec succès')
|
||||||
await router.push(`/component/${createdComponent.id}/edit`)
|
await router.replace(`/component/${createdComponent.id}/edit`)
|
||||||
}
|
}
|
||||||
else if (result.error) {
|
else if (result.error) {
|
||||||
toast.showError(result.error)
|
toast.showError(result.error)
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ const submitCreation = async () => {
|
|||||||
selectedDocuments.value = []
|
selectedDocuments.value = []
|
||||||
}
|
}
|
||||||
toast.showSuccess('Pièce créée avec succès')
|
toast.showSuccess('Pièce créée avec succès')
|
||||||
await router.push(`/pieces/${createdPiece.id}/edit`)
|
await router.replace(`/pieces/${createdPiece.id}/edit`)
|
||||||
} else if (result.error) {
|
} else if (result.error) {
|
||||||
toast.showError(result.error)
|
toast.showError(result.error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ const submitCreation = async () => {
|
|||||||
const failedFields = await saveCustomFieldValues(result.data.id)
|
const failedFields = await saveCustomFieldValues(result.data.id)
|
||||||
if (failedFields.length) {
|
if (failedFields.length) {
|
||||||
toast.showError(`Produit créé, mais impossible d'enregistrer ${failedFields.length} champ(s): ${failedFields.join(', ')}`)
|
toast.showError(`Produit créé, mais impossible d'enregistrer ${failedFields.length} champ(s): ${failedFields.join(', ')}`)
|
||||||
await router.push(`/product/${result.data.id}/edit`)
|
await router.replace(`/product/${result.data.id}/edit`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (selectedDocuments.value.length) {
|
if (selectedDocuments.value.length) {
|
||||||
@@ -352,7 +352,7 @@ const submitCreation = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
toast.showSuccess('Produit créé avec succès')
|
toast.showSuccess('Produit créé avec succès')
|
||||||
await router.push(`/product/${productId}/edit`)
|
await router.replace(`/product/${productId}/edit`)
|
||||||
}
|
}
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
toast.showError(error?.message || 'Erreur lors de la création du produit')
|
toast.showError(error?.message || 'Erreur lors de la création du produit')
|
||||||
|
|||||||
Reference in New Issue
Block a user