[Eva] bubblewords: очистка состояния + сброс счётчиков в /complete

This commit is contained in:
2026-10-14 09:20:09 +00:00
parent 07d2d197fd
commit 6399d3931c
+8 -3
View File
@@ -379,13 +379,18 @@ async def complete_bubble_level(request: Request):
score = xp_result["points"]
await conn.execute("""
INSERT INTO bubble_words_progress (user_id, levels_completed, total_score, level, current_hints_used)
VALUES ($1, 1, $2, $3, 0)
INSERT INTO bubble_words_progress
(user_id, levels_completed, total_score, level,
current_hints_used, current_list_opened, current_level_words, hinted_words)
VALUES ($1, 1, $2, $3, 0, 0, '[]'::jsonb, '{}')
ON CONFLICT (user_id) DO UPDATE
SET levels_completed = bubble_words_progress.levels_completed + 1,
total_score = bubble_words_progress.total_score + $2,
level = $3,
current_hints_used = 0
current_hints_used = 0,
current_list_opened = 0,
current_level_words = '[]'::jsonb,
hinted_words = '{}'
""", telegram_id, score, current_level)
# Данные для достижений