remove crypto position

This commit is contained in:
Justin 2023-07-11 19:29:20 +08:00 committed by GitHub
parent 9636670336
commit 32c0ea4d98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2936,7 +2936,6 @@ function removeStockPorftolio() {
} }
// update stock portfolio position with new values // update stock portfolio position with new values
function updateStockPorftolio() { function updateStockPorftolio() {
@ -2969,6 +2968,38 @@ function updateStockPorftolio() {
} }
// remove crypto portfolio position
function removeCryptoPorftolio() {
let remove_crypto_symbol = document.getElementById('inputText4').value;
if (remove_crypto_symbol !== '') {
document.getElementById('cryptoshares').value = '';
document.getElementById('cryptocost').value = '';
document.getElementById('cryptodate').value = '';
fetch("/deletePortfolioPositionCrypto", {
method: "POST",
body: JSON.stringify(remove_crypto_symbol),
});
document.getElementById('cryptoremoved-p').innerHTML = 'Crypto Position Removed!';
document.getElementById('removed-crypto-p').style.display = "block";
setTimeout(function hideElement() {
document.getElementById('removed-crypto-p').style.display = "none";
}, 5000);
}
else {
document.getElementById('cryptoremoved-p').innerHTML = 'No symbol selected.';
document.getElementById('removed-crypto-p').style.display = "block";
setTimeout(function hideElement() {
document.getElementById('removed-crypto-p').style.display = "none";
}, 5000);
}
}
// update crypto portfolio position with new values // update crypto portfolio position with new values
function updateCryptoPorftolio() { function updateCryptoPorftolio() {