fix: usdt input min validasyonu
This commit is contained in:
parent
f288eee5af
commit
43562be810
1 changed files with 6 additions and 1 deletions
|
|
@ -258,7 +258,9 @@ async function loadSymbols() {
|
|||
onChange(value) {
|
||||
const item = allSymbols.find(s => s.symbol === value);
|
||||
if (!item) return;
|
||||
document.getElementById('f-usdt').value = item.min_notional;
|
||||
const usdtInput = document.getElementById('f-usdt');
|
||||
usdtInput.value = item.min_notional;
|
||||
usdtInput.min = item.min_notional;
|
||||
document.getElementById('f-min-label').textContent = `(min ${item.min_notional} USDT)`;
|
||||
},
|
||||
});
|
||||
|
|
@ -340,7 +342,10 @@ async function createBot() {
|
|||
const usdt_amount = parseFloat(document.getElementById('f-usdt').value);
|
||||
const profit_percent = parseFloat(document.getElementById('f-profit').value);
|
||||
const testnet = document.getElementById('f-testnet').value === 'true';
|
||||
const usdtInput = document.getElementById('f-usdt');
|
||||
const minNotional = parseFloat(usdtInput.min) || 0;
|
||||
if (!name || !symbol || !usdt_amount || !profit_percent) { alert('Tüm alanları doldurun'); return; }
|
||||
if (usdt_amount < minNotional) { alert(`Minimum işlem miktarı ${minNotional} USDT`); usdtInput.focus(); return; }
|
||||
await api('POST', '/bots', { name, symbol, timeframe, usdt_amount, profit_percent, testnet });
|
||||
closeModal();
|
||||
document.getElementById('f-name').value = '';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue