fixed /newtransaction
This commit is contained in:
@@ -288,6 +288,7 @@ class API_Handler:
|
||||
int: status code
|
||||
"""
|
||||
with r.Session() as s:
|
||||
time = time[:-3] + "Z" # remove last character and add Z to make it a valid date for db
|
||||
headers = {'Authorization': 'Bearer ' + self.token + ":" + str(user_id)}
|
||||
transaction = {"comment": str(comment), "count": float(count), "isin": str(isin), "price": float(price), "time": str(time)} # set transaction as JSON with all the attributes needed according to Swagger docs
|
||||
req = s.post(self.db_adress + "/transaction", json=transaction, headers=headers)
|
||||
|
Reference in New Issue
Block a user