diff --git a/server.py b/server.py index f784a98..f3dff19 100755 --- a/server.py +++ b/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')