From 45307caee54f3af55b9f457510e5e2c4b977de59 Mon Sep 17 00:00:00 2001 From: Redume Date: Mon, 23 Dec 2024 10:04:02 +0300 Subject: [PATCH] chore: Added the multiplier directly to the api request --- utils/convert.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/utils/convert.py b/utils/convert.py index 546b242..1193c65 100644 --- a/utils/convert.py +++ b/utils/convert.py @@ -25,7 +25,7 @@ class Converter: def convert(self) -> None: if not self.kekkai(): - self.kekkai() + self.ddg() number = Decimal(str(self.conv_amount)) @@ -62,7 +62,8 @@ class Converter: res = requests.get(f'{config['kekkai_instance']}/api/getRate/', { 'from_currency': self.from_currency, 'conv_currency': self.conv_currency, - 'date': date + 'date': date, + 'conv_amount': self.conv_amount }, timeout=3) data = res.json() @@ -70,7 +71,8 @@ class Converter: if not HTTPStatus(res.status_code).is_success: return False - self.conv_amount = float(data.get('rate') * self.amount) + + self.conv_amount = data.get('conv_amount') return True except requests.exceptions.ConnectionError: