forked from justuser/CryptoDM
Табы, пробелы...
This commit is contained in:
parent
f3eb0c9435
commit
967d49506e
24
api.py
24
api.py
@ -150,18 +150,18 @@ class Coins_del(BaseModel):
|
|||||||
amount: str
|
amount: str
|
||||||
@app.post('/api/coins_del/')
|
@app.post('/api/coins_del/')
|
||||||
def coins_del(it: Coins_del):
|
def coins_del(it: Coins_del):
|
||||||
token, id, amount = it.token, it.id, abs(float(it.amount))
|
token, id, amount = it.token, it.id, abs(float(it.amount))
|
||||||
if token_check(token):
|
if token_check(token):
|
||||||
db = read()
|
db = read()
|
||||||
if db['id'][id]['bal'] >= amount:
|
if db['id'][id]['bal'] >= amount:
|
||||||
db['id'][id]['bal'] = fix_sub(db['id'][id]['bal'], amount)
|
db['id'][id]['bal'] = fix_sub(db['id'][id]['bal'], amount)
|
||||||
write(db)
|
write(db)
|
||||||
stat_run(amount*-1)
|
stat_run(amount*-1)
|
||||||
return 'OK'
|
return 'OK'
|
||||||
else:
|
else:
|
||||||
return 'Error'
|
return 'Error'
|
||||||
else:
|
else:
|
||||||
return 'Error'
|
return 'Error'
|
||||||
|
|
||||||
class Coins_transfer(BaseModel):
|
class Coins_transfer(BaseModel):
|
||||||
token: str
|
token: str
|
||||||
|
Loading…
Reference in New Issue
Block a user