diff --git a/routstr/balance.py b/routstr/balance.py index 6a2c8253..537a5324 100644 --- a/routstr/balance.py +++ b/routstr/balance.py @@ -186,11 +186,11 @@ async def refund_wallet_endpoint( bearer_value: str = authorization[7:] + key: ApiKey = await validate_bearer_key(bearer_value, session) + if cached := await _refund_cache_get(bearer_value): return cached - key: ApiKey = await validate_bearer_key(bearer_value, session) - if key.parent_key_hash: raise HTTPException( status_code=400, diff --git a/ui/components/key-options.tsx b/ui/components/key-options.tsx index 63c0fa5e..63969e72 100644 --- a/ui/components/key-options.tsx +++ b/ui/components/key-options.tsx @@ -8,6 +8,7 @@ interface KeyOptionsProps { setValidityDate: (val: string) => void; balanceLimitReset: string; setBalanceLimitReset: (val: string) => void; + showBalanceLimit?: boolean; } export function KeyOptions({ @@ -17,22 +18,25 @@ export function KeyOptions({ setValidityDate, balanceLimitReset, setBalanceLimitReset, + showBalanceLimit = true, }: KeyOptionsProps) { return (
-
- - setBalanceLimit(e.target.value)} - className='h-9 text-xs' - /> -
+ {showBalanceLimit && ( +
+ + setBalanceLimit(e.target.value)} + className='h-9 text-xs' + /> +
+ )}