implemented /removeshare
This commit is contained in:
@@ -223,7 +223,7 @@ class API_Handler:
|
||||
|
||||
Args:
|
||||
user_id (int): id of the user
|
||||
isin (string): isin of the share
|
||||
isin (string): identifier of the share (standard is isin)
|
||||
comment (string): comment of the share
|
||||
|
||||
Returns:
|
||||
@@ -240,14 +240,14 @@ class API_Handler:
|
||||
|
||||
Args:
|
||||
user_id (int): id of the user
|
||||
symbol (string): symbol of the share
|
||||
isin (string): identifier of the share (standard is isin)
|
||||
|
||||
Returns:
|
||||
int: status code
|
||||
"""
|
||||
with r.Session() as s:
|
||||
headers = {'Authorization': 'Bearer ' + self.token + ":" + str(user_id)}
|
||||
req = s.delete(self.db_adress + "/share", json={"isin": isin}, headers=headers) # to delete a share only the isin is needed because it is unique, shares are not transactions!
|
||||
req = s.delete(self.db_adress + "/share", json={"isin": str(isin)}, headers=headers) # to delete a share only the isin is needed because it is unique, shares are not transactions!
|
||||
return req.status_code
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user