delete global portfolio position added

This commit is contained in:
Justin 2023-09-26 15:47:50 +08:00 committed by GitHub
parent 934026d6ad
commit 046775c2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')