Skip to content

Commit

Permalink
Merge pull request #1276 from interval/new-transaction-on-redirect
Browse files Browse the repository at this point in the history
Explicitly create new transactions on ctx.redirect
  • Loading branch information
jacobmischka authored Jun 5, 2023
2 parents 9e9eb54 + 57511cc commit f2a608d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/examples/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2092,9 +2092,14 @@ const interval = new Interval({
{ label: 'Make it negative', theme: 'danger', value: 'negative' },
{ label: 'Do nothing', value: 'nothing' },
'Think about it for a while',
'?',
'Restart',
])

if (singleChoice === 'Restart') {
await ctx.redirect({ route: 'with_choices' })
return
}

if (singleReturnValue && singleChoice === 'negative') {
singleReturnValue = -singleReturnValue
}
Expand Down

0 comments on commit f2a608d

Please sign in to comment.