From 2eedefec8363be32b52591f92ab4d46fa8094eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20Kub=C3=AD=C4=8Dek?= Date: Tue, 4 Mar 2025 13:05:41 +0100 Subject: [PATCH] Revert "Auxiliary commit to revert individual files from 73da343c610420f68792306d5fcdd46f1c86edb8" This reverts commit e925cf182acf7c18cfd27351e72baed328d43e2c. --- superfaktura/bank_account.py | 4 +--- superfaktura/client_contacts.py | 8 +++----- superfaktura/utils/country.py | 5 +---- 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/superfaktura/bank_account.py b/superfaktura/bank_account.py index bba7633..32546a5 100644 --- a/superfaktura/bank_account.py +++ b/superfaktura/bank_account.py @@ -27,7 +27,6 @@ Usage: >>> bank.post(data) """ -import json from dataclasses import dataclass, asdict from typing import Optional @@ -93,8 +92,7 @@ class BankAccount(SuperFakturaAPI): def list(self) -> dict: """Retrieves a list of bank accounts.""" url = "bank_accounts/index" - bank_accounts = self.get(url) - return json.loads(bank_accounts) + return self.get(url) def default(self) -> Optional[BankAccountModel]: """Retrieves the default bank account.""" diff --git a/superfaktura/client_contacts.py b/superfaktura/client_contacts.py index 70676c8..a6a0c4b 100644 --- a/superfaktura/client_contacts.py +++ b/superfaktura/client_contacts.py @@ -104,14 +104,12 @@ class ClientContact(SuperFakturaAPI): def list(self) -> dict: """Lists all exists client contacts.""" url = "clients/index.json" - clients = self.get(endpoint=url) - return json.loads(clients) + return self.get(endpoint=url) def get_client(self, client_id: int) -> ClientContactModel: """Gets a client contact by ID.""" url = f"clients/view/{client_id}" - clients = self.get(endpoint=url) - data = json.loads(clients) + data = self.get(endpoint=url) if "Client" not in data: raise ClientException("Client not found") data = data["Client"] @@ -124,4 +122,4 @@ if __name__ == "__main__": pprint(resp) - pprint(client.get_client(40011)) + pprint(client.get_client(40019)) diff --git a/superfaktura/utils/country.py b/superfaktura/utils/country.py index 557a3d2..87b2672 100644 --- a/superfaktura/utils/country.py +++ b/superfaktura/utils/country.py @@ -12,8 +12,6 @@ Usage: print(countries) """ -import json - from superfaktura.superfaktura_api import SuperFakturaAPI @@ -32,5 +30,4 @@ def country_list(): """ api = SuperFakturaAPI() url = "countries" - countries = api.get(url) - return json.loads(countries) + return api.get(url)