Revert "Auxiliary commit to revert individual files from 73da343c610420f68792306d5fcdd46f1c86edb8"

This reverts commit e925cf182acf7c18cfd27351e72baed328d43e2c.
This commit is contained in:
Richard Kubíček
2025-03-04 13:05:41 +01:00
parent 532c58cbd5
commit 2eedefec83
3 changed files with 5 additions and 12 deletions

View File

@@ -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))