From 967d49506e922c84633bec635a6e32c24c9180f2 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 8 Nov 2024 19:53:16 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B0=D0=B1=D1=8B,=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B1=D0=B5=D0=BB=D1=8B...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api.py b/api.py index f7e7c66..c1460b7 100644 --- a/api.py +++ b/api.py @@ -150,18 +150,18 @@ class Coins_del(BaseModel): amount: str @app.post('/api/coins_del/') def coins_del(it: Coins_del): - token, id, amount = it.token, it.id, abs(float(it.amount)) - if token_check(token): - db = read() - if db['id'][id]['bal'] >= amount: - db['id'][id]['bal'] = fix_sub(db['id'][id]['bal'], amount) - write(db) - stat_run(amount*-1) - return 'OK' - else: - return 'Error' - else: - return 'Error' + token, id, amount = it.token, it.id, abs(float(it.amount)) + if token_check(token): + db = read() + if db['id'][id]['bal'] >= amount: + db['id'][id]['bal'] = fix_sub(db['id'][id]['bal'], amount) + write(db) + stat_run(amount*-1) + return 'OK' + else: + return 'Error' + else: + return 'Error' class Coins_transfer(BaseModel): token: str