From 1cd16a4eccfbd54c96efe81b7b6f3ea09ef7c591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Sat, 16 Mar 2024 13:56:59 -0400 Subject: [PATCH] fix(client-side): change story content field name in yup schema --- lib/client/storyFormSchema.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/client/storyFormSchema.ts b/lib/client/storyFormSchema.ts index 358eaa6..df70dfa 100644 --- a/lib/client/storyFormSchema.ts +++ b/lib/client/storyFormSchema.ts @@ -26,7 +26,7 @@ export const cs = yup.object().shape({ }), hidden: yup.boolean().oneOf([true, false]), pot: yup.string().oneOf(["pasteOrType", "upload"]).required("Story content is required!"), - storytext: yup.string().when("pot", ([pot], schema) => { + content: yup.string().when("pot", ([pot], schema) => { return pot === "pasteOrType" ? schema .test("numWords", "Story must be at least 50 words", (value: any, context) => { @@ -56,7 +56,7 @@ export const cs = yup.object().shape({ } else { ext = (value as File)?.name?.split(".").reverse()[0]; } - // + // let reg = /(docx|doc)$/i; return reg.test(ext); },