Skip to content

Commit

Permalink
fix(Tunnel gaspillage): Les erreurs ne s'effaçaient pas (#4998)
Browse files Browse the repository at this point in the history
  • Loading branch information
Charline-L authored Feb 4, 2025
1 parent 37c4a0c commit 5c6e8c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions 2024-frontend/src/stores/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ export const useRootStore = defineStore("root", () => {
const idx = notifications.indexOf(notification)
if (idx > -1) notifications.splice(idx, 1)
}
const removeNotifications = () => {
notifications.splice(0)
}

const createWasteMeasurement = async (canteenId, payload) => {
return fetch(`/api/v1/canteens/${canteenId}/wasteMeasurements/`, {
Expand Down Expand Up @@ -114,6 +117,7 @@ export const useRootStore = defineStore("root", () => {
notifyRequiredFieldsError,
notifyServerError,
removeNotification,
removeNotifications,
sendInquiryEmail,
}
})
2 changes: 2 additions & 0 deletions 2024-frontend/src/views/WasteMeasurementTunnel/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const formIsValid = () => {
}
const continueAction = () => {
store.removeNotifications()
if (step.value.isSynthesis) {
quit()
return
Expand All @@ -94,6 +95,7 @@ const continueAction = () => {
}
const navigateBack = () => {
store.removeNotifications()
router.push({ query: { étape: previousStep.value.urlSlug } })
scrollTop()
}
Expand Down

0 comments on commit 5c6e8c3

Please sign in to comment.