Skip to content

Commit 2a2b236

Browse files
committed
add min prompt length
1 parent 3a255de commit 2a2b236

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pcweb/pages/landing/views/hero.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ class SubmitPromptState(rx.State):
4040
@rx.event(background=True, temporal=True)
4141
async def redirect_to_ai_builder(self, form_data: dict):
4242
if prompt := form_data.get("prompt"):
43+
if len(prompt) < 5:
44+
return rx.toast.warning(
45+
"Your prompt needs at least 5 characters. Please add more details.",
46+
)
4347
random_uuid = uuid.uuid4()
4448
async with httpx.AsyncClient() as client:
4549
response = await client.post(

0 commit comments

Comments
 (0)