remove stock position

This commit is contained in:
Justin 2023-07-11 19:09:46 +08:00 committed by GitHub
parent 7d4fa5154f
commit 912bfde7f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2903,6 +2903,36 @@ function getCryptoSymbol(value) {
// remove stock portfolio position
function removeStockPorftolio() {
let remove_stock_symbol = document.getElementById('inputText3').value;
if (remove_stock_symbol !== '') {
document.getElementById('inputText9').value = '';
document.getElementById('inputText8').value = '';
document.getElementById('inputText10').value = '';
fetch("/deletePortfolioSettings", {
method: "POST",
body: JSON.stringify(remove_stock_symbol),
});
document.getElementById('removed-stock-p').innerHTML = 'Stock Position Removed!';
document.getElementById('removed-stock-p').style.display = "block";
setTimeout(function hideElement() {
document.getElementById('removed-stock-p').style.display = "none";
}, 5000);
} else {
document.getElementById('removed-stock-p').innerHTML = 'No symbol selected.';
document.getElementById('removed-stock-p').style.display = "block";
setTimeout(function hideElement() {
document.getElementById('removed-stock-p').style.display = "none";
}, 5000);
}
}
// update stock portfolio position with new values
function updateStockPorftolio() {