Skip to content

Commit

Permalink
Update src/router.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Hamery <[email protected]>
  • Loading branch information
jenovateurs and Shamzic authored Oct 11, 2024
1 parent 996c379 commit 7f435d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,9 @@ router.beforeEach((to, from, next) => {

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

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

0 comments on commit 7f435d6

Please sign in to comment.