delete global portfolio position added
This commit is contained in:
parent
934026d6ad
commit
046775c2d3
18
server.py
18
server.py
@ -2217,6 +2217,24 @@ def deletePortfolioPosition():
|
||||
return index()
|
||||
|
||||
|
||||
@app.route("/deleteGlobalPortfolioPosition", methods=["POST"])
|
||||
def deleteGlobalPortfolioPosition():
|
||||
value = request.data.decode('utf-8')
|
||||
value2 = json.loads(value)
|
||||
try:
|
||||
with open("csv/portfolio_global_settings.json") as f:
|
||||
data = json.load(f)
|
||||
except:
|
||||
data = {"symbols": {}}
|
||||
try:
|
||||
del data["symbols"][value2]
|
||||
with open('csv/portfolio_global_settings.json', 'w') as f:
|
||||
json.dump(data, f)
|
||||
except:
|
||||
pass
|
||||
return index()
|
||||
|
||||
|
||||
@app.route("/fetchStockPortfolio", methods=["POST"])
|
||||
def fetchStockPortfolio():
|
||||
value = request.data.decode('utf-8')
|
||||
|
Loading…
x
Reference in New Issue
Block a user