File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
__fixtures__/test-project-rsa/web/src Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 33import { randomWords } from './words'
44
55export async function onSend ( formData : FormData ) {
6- console . log ( 'message' , formData . get ( 'message' ) )
6+ const message = formData . get ( 'message' )
7+
8+ console . log ( 'message' , message )
9+
10+ if ( typeof message !== 'string' ) {
11+ throw new Error ( 'message must be a string' )
12+ }
713
814 // Locally you could do this:
915 // const words = await fetch(
@@ -12,5 +18,6 @@ export async function onSend(formData: FormData) {
1218 // But in CI we don't want to hit an external API, so we just do this instead:
1319 const words = await randomWords ( 5 )
1420
15- return { messages : [ formData . get ( ' message' ) , words . join ( ' ' ) ] }
21+ return { messages : [ message , words . join ( ' ' ) ] }
1622}
23+
You can’t perform that action at this time.
0 commit comments