aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/dashboard
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-04-01 02:16:04 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-04-01 02:16:04 -0400
commit0e9c0803e35a23ef2e873dc7ebf224a49a92f207 (patch)
tree98583e1b1d21d1a0cc57e8ff3489fbbf758eccff /ufund-ui/src/app/components/dashboard
parent61daadccf89b2b84820386558ac454c0123d4299 (diff)
downloadJellySolutions-0e9c0803e35a23ef2e873dc7ebf224a49a92f207.tar.gz
JellySolutions-0e9c0803e35a23ef2e873dc7ebf224a49a92f207.tar.bz2
JellySolutions-0e9c0803e35a23ef2e873dc7ebf224a49a92f207.zip
Get everything working enough to go in main
Diffstat (limited to 'ufund-ui/src/app/components/dashboard')
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.html2
-rw-r--r--ufund-ui/src/app/components/dashboard/dashboard.component.ts9
2 files changed, 8 insertions, 3 deletions
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.html b/ufund-ui/src/app/components/dashboard/dashboard.component.html
index 330d1f3..6a95ecd 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.html
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.html
@@ -2,4 +2,4 @@
<h1>Your Dashboard</h1>
<app-mini-need-list [needList]="topNeeds" jtitle="Top needs" url="/cupboard"/>
<app-mini-need-list [needList]="almostThere" jtitle="Almost there" url="/cupboard"/>
-<app-mini-need-list [needList]="inBasket" jtitle="In your basket" url="/cupboard"/>
+<app-mini-need-list [needList]="inBasket" jtitle="In your basket" url="/basket"/>
diff --git a/ufund-ui/src/app/components/dashboard/dashboard.component.ts b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
index 645893f..c94b5c6 100644
--- a/ufund-ui/src/app/components/dashboard/dashboard.component.ts
+++ b/ufund-ui/src/app/components/dashboard/dashboard.component.ts
@@ -4,6 +4,7 @@ import {Router} from '@angular/router';
import {Need} from '../../models/Need';
import {CupboardService} from '../../services/cupboard.service';
import {firstValueFrom} from 'rxjs';
+import {UsersService} from '../../services/users.service';
@Component({
selector: 'app-dashboard',
@@ -20,7 +21,8 @@ export class DashboardComponent implements OnInit{
constructor(
protected authService: AuthService,
protected router: Router,
- protected cupboardService: CupboardService
+ protected cupboardService: CupboardService,
+ protected userService: UsersService
) {}
ngOnInit() {
@@ -33,7 +35,10 @@ export class DashboardComponent implements OnInit{
firstValueFrom(this.cupboardService.getNeeds()).then(r => {
this.topNeeds = r.sort((a, b) => b.current - a.current)
this.almostThere = r.sort((a, b) => a.current/a.maxGoal - b.current/b.maxGoal)
- this.inBasket = r.filter(n => n.id in user!.basket)
+ })
+
+ this.userService.getBasket().subscribe(r => {
+ this.inBasket = r;
})
}