diff --git a/src/app/portfolio/[slug]/(portfolio)/settings/PortfolioSettings.tsx b/src/app/portfolio/[slug]/(portfolio)/settings/PortfolioSettings.tsx index c8be486..d351544 100644 --- a/src/app/portfolio/[slug]/(portfolio)/settings/PortfolioSettings.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/settings/PortfolioSettings.tsx @@ -64,43 +64,45 @@ export default function PortfolioSettings({ const [portfolioName, setPortfolioName] = useState( portfolioSettingsData.name ); + + const [portfolioBudget, setPortfolioBudget] = useState< + number | string | null + >(portfolioSettingsData.budget); + const [portfolioGoal, setPortfolioGoal] = useState( portfolioSettingsData.goal ); + const [portfolioStatus, setPortfolioStatus] = useState( portfolioSettingsData.status ); - function handleRename() { - // API call to rename the portfolio - // apiFunction(portfolioName) - // Update portfolio function with name is equal to portfolioName - router.refresh(); - } + // Renaming functionality function handlePortfolioNameChange(e: React.ChangeEvent) { setPortfolioName(e.target.value); } - // Last thing we'd need to do is make that update in the db + function handleRename() { + // API call to rename the portfolio + // apiFunction(portfolioName) + // Update portfolioName + router.refresh(); + } //Change budget functionality - const [portfolioBudget, setPortfolioBudget] = useState< - number | string | null - >(portfolioSettingsData.budget); + + function handlePortfolioBudgetUpdate(e: React.ChangeEvent) { + setPortfolioBudget(Number(e.target.value)); + } function handleBudgetUpdate() { // API call to change the budget // apiFunction(portfolioBudget) - // Update portfolio function with budget is equal to portfolioBudget - console.log(portfolioBudget); + // Update portfolioBudget router.refresh(); } - function handlePortfolioBudgetUpdate(e: React.ChangeEvent) { - setPortfolioBudget(Number(e.target.value)); - } - return ( <>