Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 834fb0eda9 | |||
| b4f889def2 | |||
| b748aeaabe |
+5
-4
@@ -97,12 +97,13 @@ async def get_user_images(user_id: int, limit: int = 10) -> List[Dict[str, Any]]
|
||||
"""Получение истории обработанных изображений пользователя"""
|
||||
async with aiosqlite.connect(DATABASE_PATH) as db:
|
||||
db.row_factory = aiosqlite.Row
|
||||
async with db.execute("""
|
||||
cursor = await db.execute("""
|
||||
SELECT id, original_file_id, processed_file_id, prompt, status, created_at, completed_at
|
||||
FROM images
|
||||
WHERE user_id = ?
|
||||
ORDER BY created_at DESC
|
||||
LIMIT ?
|
||||
""", (user_id, limit)) as cursor:
|
||||
rows = await cursor.fetchall()
|
||||
return [dict(row) for row in rows]
|
||||
""", (user_id, limit))
|
||||
rows = await cursor.fetchall()
|
||||
await db.commit()
|
||||
return [dict(row) for row in rows]
|
||||
Reference in New Issue
Block a user