delete stock portfolio

This commit is contained in:
Justin 2023-07-11 19:12:04 +08:00 committed by GitHub
parent 912bfde7f6
commit e8c6e40059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1516,6 +1516,22 @@ def setTop20or10():
@app.route("/deletePortfolioSettings", methods=["POST"])
def deletePortfolioSettings():
value = request.data.decode('utf-8')
value2 = json.loads(value)
try:
with open("csv/portfolio_settings.json") as f:
data = json.load(f)
except:
data = {"symbols": {}}
try:
del data["symbols"][value2]
except:
pass
return index()
@app.route("/fetchStockPortfolio", methods=["POST"])
def fetchStockPortfolio():
value = request.data.decode('utf-8')