mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
copied mutate function for status and goal
This commit is contained in:
parent
74ac3783b9
commit
0a7e110bf6
1 changed files with 20 additions and 15 deletions
|
|
@ -243,18 +243,28 @@ export default function PortfolioSettings({
|
|||
|
||||
// The onClick function called to update the GOAL in the DB
|
||||
|
||||
function handleGoalUpdateDb() {
|
||||
// apiGoalChangeFunction(portfolioSettingsData.goal)
|
||||
// Update portfolioGoal
|
||||
router.refresh();
|
||||
function handleGoalUpdate() {
|
||||
mutate({
|
||||
userId,
|
||||
portfolioId,
|
||||
name: null,
|
||||
budget: null,
|
||||
goal: portfolioGoal,
|
||||
status: null,
|
||||
});
|
||||
}
|
||||
|
||||
// The onClick function called to update the BUDGET in the DB
|
||||
|
||||
function handleStatusUpdateDb() {
|
||||
// apiStatusChangeFunction(portfolioSettingsData.status)
|
||||
// Update portfolioStatus
|
||||
router.refresh();
|
||||
function handleStatusUpdate() {
|
||||
mutate({
|
||||
userId,
|
||||
portfolioId,
|
||||
name: null,
|
||||
budget: null,
|
||||
goal: null,
|
||||
status: portfolioStatus,
|
||||
});
|
||||
}
|
||||
|
||||
// HTML to render the page
|
||||
|
|
@ -311,7 +321,7 @@ export default function PortfolioSettings({
|
|||
setOption={setPortfolioGoal}
|
||||
/>
|
||||
</div>
|
||||
<Button className="w-full" onClick={handleGoalUpdateDb}>
|
||||
<Button className="w-full" onClick={handleGoalUpdate}>
|
||||
Update
|
||||
</Button>
|
||||
|
||||
|
|
@ -326,15 +336,10 @@ export default function PortfolioSettings({
|
|||
setOption={setPortfolioStatus}
|
||||
/>
|
||||
</div>
|
||||
<Button className="w-full" onClick={handleStatusUpdateDb}>
|
||||
<Button className="w-full" onClick={handleStatusUpdate}>
|
||||
Update
|
||||
</Button>
|
||||
|
||||
<div className="col-span-3"> Portfolio Name: {portfolioName}</div>
|
||||
<div className="col-span-3"> Portfolio Budget: {portfolioBudget}</div>
|
||||
<div className="col-span-3"> Goal value: {portfolioGoal}</div>
|
||||
<div> Status value: {portfolioStatus}</div>
|
||||
|
||||
{/* Row 5: Delete */}
|
||||
<div className="col-span-2"></div>
|
||||
<div className="flex items-center">
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue