Skip to content

Commit

Permalink
Automatically saves duplicated declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
alemangui committed Oct 31, 2024
1 parent 22c1b4b commit 76be36f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions frontend/src/views/ProducerFormPage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ watch(data, () => {
const shouldDuplicate = route.query.duplicate && !props.id
if (shouldDuplicate) {
performDuplication(data.value)
useToaster().addSuccessMessage("Votre déclaration a été dupliquée. Merci de renseigner les pièces jointes.")
savePayload("Votre déclaration a été dupliquée. Merci de renseigner les pièces jointes.")
} else payload.value = data.value
})
Expand Down Expand Up @@ -193,7 +193,7 @@ const components = computed(() => {
const titles = computed(() => tabTitles(components.value, !readonly.value))
const savePayload = async () => {
const savePayload = async (successMessage = "Votre démarche a été sauvegardée") => {
const isNewDeclaration = !payload.value.id
const url = isNewDeclaration
? `/api/v1/users/${loggedUser.value.id}/declarations/`
Expand Down Expand Up @@ -225,7 +225,7 @@ const savePayload = async () => {
useToaster().addMessage({
type: "success",
id: "declaration-success",
description: "Votre démarche a été sauvegardée",
description: successMessage,
})
return true
}
Expand Down

0 comments on commit 76be36f

Please sign in to comment.