complete the if statement determining if the portfolioName and deleteConfirmationByName match,added some error handling to the handleDeleteConfirmation function

This commit is contained in:
StefanWout 2024-10-18 15:05:59 +01:00
parent 42782a8db1
commit 36ec9a8df2

View file

@ -93,8 +93,18 @@ export default function PortfolioSettings({
const [deleteConfirmationByName, setDeleteConfirmationByName] = useState("")
function handleDeleteConfirmation() {
// if (deleteConfirmationByName === portfolioName)
console.log("we be deletin stuff")
if (deleteConfirmationByName === portfolioName) {
//API call to delete portfolio
//deletePortfolio(portfolioId)
router.refresh();
setIsDeleteModalOpen(false);
} else {
// Error if the names don't match
console.log("Portfolio name does not match");
}
}
}
// RENAMING FUNCTIONS