update crypto position
This commit is contained in:
@@ -2933,3 +2933,37 @@ function updateStockPorftolio() {
|
|||||||
stockValidate();
|
stockValidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// update crypto portfolio position with new values
|
||||||
|
function updateCryptoPorftolio() {
|
||||||
|
|
||||||
|
let update_crypto_cost = document.getElementById('cryptocost').value;
|
||||||
|
let update_crypto_shares = document.getElementById('cryptoshares').value;
|
||||||
|
let update_crypto_symbol = document.getElementById('inputText4').value;
|
||||||
|
let update_crypto_days = document.getElementById('cryptodate').value;
|
||||||
|
|
||||||
|
let update_crypto_settings = {
|
||||||
|
shares:update_crypto_shares,
|
||||||
|
cost:update_crypto_cost,
|
||||||
|
symbol:update_crypto_symbol,
|
||||||
|
days:update_crypto_days,
|
||||||
|
};
|
||||||
|
|
||||||
|
if ((update_crypto_shares !== '') && (update_crypto_cost !== '') && (update_crypto_days !== '') && (update_crypto_symbol !== '')) {
|
||||||
|
fetch("/savePortfolioCryptoSettings", {
|
||||||
|
method: "POST",
|
||||||
|
body: JSON.stringify(update_crypto_settings),
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById('updated-crypto-p').style.display = "block";
|
||||||
|
setTimeout(function hideElement() {
|
||||||
|
document.getElementById('updated-crypto-p').style.display = "none";
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
cryptoValidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user