FEAT: Implemented working search bar using FTS and Ranking
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user