add img to bonus and endpoint toogle activation bonus

This commit is contained in:
2025-12-07 17:26:43 +05:00
parent d4b1c1f5ee
commit a0808d29fa
4 changed files with 79 additions and 2 deletions

View File

@ -45,3 +45,12 @@ async def upgrade_user_bonus(username: str = Body(...), bonus_id: str = Body(...
from app.services.bonus import BonusService
return await BonusService().upgrade_bonus(username, bonus_id)
@router.post("/toggle-activation")
async def toggle_bonus_activation(username: str = Body(...), bonus_id: str = Body(...)):
"""
Переключить активность бонуса пользователя.
Передаём username и bonus_id, is_active переключается на противоположное значение.
"""
from app.services.bonus import BonusService
return await BonusService().toggle_bonus_activation(username, bonus_id)