delete crypto position func
This commit is contained in:
parent
32c0ea4d98
commit
17729b184f
18
server.py
18
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"])
|
@app.route("/deletePortfolioPosition", methods=["POST"])
|
||||||
def deletePortfolioPosition():
|
def deletePortfolioPosition():
|
||||||
value = request.data.decode('utf-8')
|
value = request.data.decode('utf-8')
|
||||||
|
Loading…
Reference in New Issue
Block a user