fix: use money endpoint for scout token wallet deduction
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m24s
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m24s
db_patch with wallet param was silently ignored by the API — wallet
mutations require the dedicated teams/{id}/money/{amount} endpoint.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ce894cfa64
commit
7e406f1a06
@ -11,7 +11,7 @@ import logging
|
||||
|
||||
import discord
|
||||
|
||||
from api_calls import db_get, db_patch, db_post
|
||||
from api_calls import db_get, db_post
|
||||
from helpers.main import get_team_by_owner, get_card_embeds
|
||||
from helpers.scouting import (
|
||||
SCOUT_TOKEN_COST,
|
||||
@ -340,9 +340,7 @@ class BuyScoutTokenView(discord.ui.View):
|
||||
# Deduct currency
|
||||
new_wallet = team["wallet"] - SCOUT_TOKEN_COST
|
||||
try:
|
||||
await db_patch(
|
||||
"teams", object_id=team["id"], params=[("wallet", new_wallet)]
|
||||
)
|
||||
await db_post(f'teams/{team["id"]}/money/-{SCOUT_TOKEN_COST}')
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to deduct scout token cost: {e}")
|
||||
await interaction.response.edit_message(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user