fix: 링크 저장 및 에러 메시지 개선
- created_at 기본값이 없어도 저장되도록 NOW()로 기록 - API 오류 발생 시 detail을 함께 표시 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
3
app.py
3
app.py
@@ -238,7 +238,8 @@ def add_link():
|
||||
with get_db_connection() as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute(
|
||||
f"INSERT INTO {table} (url) VALUES (%s) RETURNING id, created_at",
|
||||
# created_at에 DEFAULT가 없더라도 저장되도록 NOW()를 함께 기록
|
||||
f"INSERT INTO {table} (url, created_at) VALUES (%s, NOW()) RETURNING id, created_at",
|
||||
(url,),
|
||||
)
|
||||
link_id, created_at = cur.fetchone()
|
||||
|
||||
Reference in New Issue
Block a user