fixed case sensitive commands
This commit is contained in:
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user