Add keyword length limit to search function to prevent search overload

This commit is contained in:
PrinOrange
2024-01-09 16:57:42 +08:00
parent bcde008408
commit 4196dfc641
2 changed files with 8 additions and 0 deletions

View File

@@ -52,6 +52,10 @@ export default function SearchPage() {
toast({ title: "Enter a Keyword", description: "Please enter one keyword at least." });
return;
}
if (searchText.length < 10) {
toast({ title: "Keywords too short", description: "Keyword length must be at least 10." });
return;
}
querySearch.refetch();
};