diff --git a/db/SQLiteClient.py b/db/SQLiteClient.py index 068541c..d6e0481 100644 --- a/db/SQLiteClient.py +++ b/db/SQLiteClient.py @@ -45,9 +45,9 @@ def get_user_by_email(email: str): def update_user(id: int, name: str, email: str, password: str = None): now = datetime.now().isoformat() if password: - query = f"UPDATE users SET name = '{name}', email = '{email}', password = '{password}', updated_at = {now} WHERE id = {id};" + query = f"UPDATE users SET name = '{name}', email = '{email}', password = '{password}', updated_at = '{now}' WHERE id = {id};" else: - query = f"UPDATE users SET name = '{name}', email = '{email}', updated_at = {now} WHERE id = {id};" + query = f"UPDATE users SET name = '{name}', email = '{email}', updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query) @@ -144,7 +144,7 @@ def get_slots(user_id: int): def update_slot(id: int, slot: int): now = datetime.now().isoformat() - query = f"UPDATE habits SET slot = {slot}, updated_at = {now} WHERE id = {id};" + query = f"UPDATE habits SET slot = {slot}, updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query) @@ -155,7 +155,7 @@ def update_slot(id: int, slot: int): def update_habit(id: int, name: str, note: str, times: int, unit: int): now = datetime.now().isoformat() - query = f"UPDATE habits SET name = {name}, note = {note}, times = {times}, unit = {unit}, updated_at = {now} WHERE id = {id};" + query = f"UPDATE habits SET name = {name}, note = {note}, times = {times}, unit = {unit}, updated_at = '{now}' WHERE id = {id};" conn = con3() cursor = conn.cursor() cursor.execute(query)