fetch global portfolio settings function
This commit is contained in:
parent
fd782c6fbe
commit
013ee0eb7e
17
server.py
17
server.py
@ -2234,6 +2234,23 @@ def fetchStockPortfolio():
|
||||
return (stock_pos_info)
|
||||
|
||||
|
||||
@app.route("/fetchGlobalStockPortfolio", methods=["POST"])
|
||||
def fetchGlobalStockPortfolio():
|
||||
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:
|
||||
globalstock_pos_info = data['symbols'][value2]
|
||||
except:
|
||||
globalstock_pos_info = {}
|
||||
|
||||
return (globalstock_pos_info)
|
||||
|
||||
|
||||
@app.route("/fetchCryptoPortfolio", methods=["POST"])
|
||||
def fetchCryptoPortfolio():
|
||||
value = request.data.decode('utf-8')
|
||||
|
Loading…
Reference in New Issue
Block a user