fixed case sensitive commands

This commit is contained in:
Linus E
2022-04-19 21:36:16 +02:00
parent 71fed7fd18
commit 7a4a8aaedc
2 changed files with 33 additions and 31 deletions

View File

@@ -270,22 +270,23 @@ class API_Handler:
return self.get_user_transactions(user_id, max_retries-1)
def set_transaction(self, user_id, count, price, symbol, timestamp):
def set_transaction(self, user_id, comment, isin, count, price, time):
"""sets the transaction of the user
Args:
user_id (int): id of the user
comment (string): comment of the transaction
isin (string): isin of the transaction
count (int): count of the transaction
price (float): price of the transaction
symbol (string): symbol of the transaction
timestamp (string): timestamp of the transaction
time (string): time of the transaction
Returns:
int: status code
"""
with r.Session() as s:
headers = {'Authorization': 'Bearer ' + self.token + ":" + str(user_id)}
transaction = {"count": count, "price": price, "symbol": symbol, "time": timestamp}
transaction = {"comment": comment, "count": count, "isin": isin, "price": price, "time": time}
req = s.post(self.db_adress + "/transaction", json=transaction, headers=headers)
return req.status_code