am i allowed to get away with spreading it

This commit is contained in:
MeowcaTheoRange 2023-10-20 21:14:47 -05:00
parent 13feb970b0
commit 0c579279fa
3 changed files with 12 additions and 12 deletions

View file

@ -26,8 +26,7 @@ export default function ClanFormTemplate({
return (
<Formik
initialValues={
initialValues ??
({
{
name: "",
description: "",
url: "",
@ -37,8 +36,9 @@ export default function ClanFormTemplate({
pronouns: [["", "", ""]]
}
],
code: getCookie("TROLLCALL_CODE")
} as SubmitClan)
code: getCookie("TROLLCALL_CODE"),
...(initialValues ?? {})
} as SubmitClan
}
validationSchema={SubmitClanSchema}
onSubmit={async (values, { setSubmitting, setErrors, setFieldError }) => {

View file

@ -24,12 +24,12 @@ export default function MessageFormTemplate({
return (
<Formik
initialValues={
initialValues ??
({
{
to: "",
body: "",
subject: ""
} as SubmitMessage)
subject: "",
...(initialValues ?? {})
} as SubmitMessage
}
validationSchema={SubmitMessageSchema}
onSubmit={async (values, { setSubmitting, setErrors, setFieldError }) => {

View file

@ -33,8 +33,7 @@ export default function TrollFormTemplate({
return (
<Formik
initialValues={
initialValues ??
({
{
name: ["", ""],
description: "",
pronunciation: ["", ""],
@ -44,8 +43,9 @@ export default function TrollFormTemplate({
["they", "them", "theirs"]
],
gender: "",
images: [""]
} as SubmitTroll)
images: [""],
...(initialValues ?? {})
} as SubmitTroll
}
validationSchema={SubmitTrollSchema}
onSubmit={async (values, { setSubmitting, setErrors, setFieldError }) => {