diff --git a/server.py b/server.py index c38efa9..f11f092 100755 --- a/server.py +++ b/server.py @@ -1516,6 +1516,24 @@ def setTop20or10(): +@app.route("/deletePortfolioPositionCrypto", methods=["POST"]) +def deletePortfolioPositionCrypto(): + value = request.data.decode('utf-8') + value2 = json.loads(value) + try: + with open("csv/portfolio_crypto_settings.json") as f: + data = json.load(f) + except: + data = {"symbols": {}} + try: + del data["symbols"][value2] + with open('csv/portfolio_crypto_settings.json', 'w') as f: + json.dump(data, f) + except: + pass + return index() + + @app.route("/deletePortfolioPosition", methods=["POST"]) def deletePortfolioPosition(): value = request.data.decode('utf-8')