Skip to content

Commit

Permalink
fix: gestion valeur null enfants
Browse files Browse the repository at this point in the history
  • Loading branch information
jenovateurs committed Oct 7, 2024
1 parent 93635d6 commit 996c379
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,11 @@ router.beforeEach((to, from, next) => {

if (current.includes(enfantPath)) {
const id_enfant = current.split(enfantPath)[1].split("/")[0]
const hasStoreChild = store.situation.enfants.find(
(enfant) => enfant.id === `enfant_${id_enfant}`
)
const hasStoreChild = store.situation.enfants
? store.situation.enfants.find(
(enfant) => enfant.id === `enfant_${id_enfant}`
)
: false

if (!hasStoreChild) {
// go(-2) used to skip the "/enfants" step on the removed child first step "_firstName"
Expand Down

0 comments on commit 996c379

Please sign in to comment.