FEAT: Implemented working search bar using FTS and Ranking

This commit is contained in:
white
2025-02-11 16:38:46 +00:00
parent 905e879c60
commit 1a572cc172
5 changed files with 53 additions and 26 deletions

View File

@@ -37,7 +37,7 @@ def get_most_popular_category() -> Optional[List[dict]]:
return category
def sanitize(user_input: str, input_type="username") -> str:
def sanitize(user_input: str, input_type="default") -> str:
"""
Sanitizes user input based on the specified input type.
@@ -63,6 +63,11 @@ def sanitize(user_input: str, input_type="username") -> str:
"min_length": 8,
"max_length": 256,
},
"default": {
"pattern": r"^[\S]+$", # Non-whitespace characters only
"min_length": 1,
"max_length": 50,
},
}
# Get the validation rules for the specified type