EmailCRUD
Some checks failed
K8S Fission Deployment / Deployment fission functions (push) Failing after 21s

This commit is contained in:
QuangMinh_123
2025-12-06 14:35:57 +00:00
parent c871216ae0
commit 590492fffa
3 changed files with 10 additions and 9 deletions

View File

@@ -168,13 +168,13 @@ def add_email_to_user(user_id: str, email: str): # Add email
with conn.cursor() as cursor:
cursor.execute("""
SELECT user_id FROM ailbl_user_email WHERE email = %s;
""", (email,))
existing = cursor.fetchone()
if existing:
""", (email,)) # Truy van ra ket qua email
existing = cursor.fetchone() # Tao ra bien existing save email duoc add
if existing:
return {"errorCode": "EMAIL_ALREADY_EXISTS"}, 409, CORS_HEADERS
id = str(uuid_lib.uuid4())
provider = auto_detect_provider(email)
id = str(uuid_lib.uuid4())
provider = auto_detect_provider(email) # Ham xu li lay phan sau cua @
cursor.execute("""
INSERT INTO ailbl_user_email (id, user_id, email, provider, created, modified)
VALUES (%s, %s, %s, %s, now(), now())