Skip to content

Commit

Permalink
Fix segmentCount type in formik string field (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
jajakob authored Oct 15, 2024
1 parent 14a6655 commit e4a8a41
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/demo-game/src/pages/admin/games/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,10 @@ function ManageGame() {
<Formik
initialValues={{
periodName: 'Game Period',
segmentCount: 4,
segmentCount: '4',
}}
onSubmit={async (variables, { resetForm }) => {
const segmentCount: number = parseInt(variables.segmentCount)
await addGamePeriod({
variables: {
gameId: Number(router.query.id),
Expand All @@ -500,7 +501,7 @@ function ManageGame() {
['stockTrend', 'stockVariance', 'stockGap'],
variables
),
segmentCount: variables.segmentCount,
segmentCount: segmentCount,
},
})
resetForm()
Expand Down

0 comments on commit e4a8a41

Please sign in to comment.