Skip to content

Commit

Permalink
Subsubsection: fix estimatedCompletionDate schema
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannaPeanut committed Feb 5, 2024
1 parent 465720c commit 80889c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ const EditSubsubsection = () => {
id: subsubsection.id,
...values,
trafficLoadDate: values.trafficLoadDate === "" ? null : new Date(values.trafficLoadDate),
estimatedCompletionDate:
values.estimatedCompletionDate === "" ? null : new Date(values.estimatedCompletionDate),
})
await setQueryData(updated)
await router.push(
Expand Down Expand Up @@ -97,6 +99,9 @@ const EditSubsubsection = () => {
trafficLoadDate: subsubsection.trafficLoadDate
? getDate(subsubsection.trafficLoadDate)
: "",
estimatedCompletionDate: subsubsection.estimatedCompletionDate
? getDate(subsubsection.estimatedCompletionDate)
: "",
}}
onSubmit={handleSubmit}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const NewSubsubsection = () => {
subsectionId: subsection!.id,
// @ts-ignore
trafficLoadDate: values.trafficLoadDate === "" ? null : new Date(values.trafficLoadDate),
// @ts-ignore
estimatedCompletionDate:
// @ts-ignore
values.estimatedCompletionDate === "" ? null : new Date(values.estimatedCompletionDate),
})
await router.push(
Routes.SubsubsectionDashboardPage({
Expand Down

0 comments on commit 80889c7

Please sign in to comment.