fix(client-side): change story content field name in yup schema
This commit is contained in:
		
							parent
							
								
									739cfb5eff
								
							
						
					
					
						commit
						1cd16a4ecc
					
				| @ -26,7 +26,7 @@ export const cs = yup.object<FormChapter>().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<FormChapter>().shape({ | ||||
| 								} else { | ||||
| 									ext = (value as File)?.name?.split(".").reverse()[0]; | ||||
| 								} | ||||
| 								// 
 | ||||
| 								//
 | ||||
| 								let reg = /(docx|doc)$/i; | ||||
| 								return reg.test(ext); | ||||
| 							}, | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user