feat(chat): add random public_id and fix users blocked route
Some checks failed
CI / test (push) Failing after 20s
Some checks failed
CI / test (push) Failing after 20s
- add chats.public_id random identifier with migration 0011
- expose public_id in chat API payloads
- use chat public_id in message search UI label
- fix users router order so /users/blocked no longer conflicts with /users/{user_id}
This commit is contained in:
9
app/utils/id_generator.py
Normal file
9
app/utils/id_generator.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import secrets
|
||||
import string
|
||||
|
||||
|
||||
_ALPHABET = string.ascii_letters + string.digits
|
||||
|
||||
|
||||
def generate_public_id(length: int = 12) -> str:
|
||||
return "".join(secrets.choice(_ALPHABET) for _ in range(length))
|
||||
Reference in New Issue
Block a user