fetch global portfolio settings function

This commit is contained in:
Justin 2023-09-26 15:23:14 +08:00 committed by GitHub
parent fd782c6fbe
commit 013ee0eb7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')