aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list/need-list.component.ts
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-03-17 17:08:04 -0400
committerbenal01 <bja4245@rit.edu>2025-03-17 17:08:04 -0400
commitbf33fa3ca9f29b1e75cc077ae2eaaf4f5725e4b3 (patch)
tree9a5d7255a75022407485d3687e07e96419bc416b /ufund-ui/src/app/components/need-list/need-list.component.ts
parent636ba167db911130097c99c4b199b144b3d80808 (diff)
downloadJellySolutions-bf33fa3ca9f29b1e75cc077ae2eaaf4f5725e4b3.tar.gz
JellySolutions-bf33fa3ca9f29b1e75cc077ae2eaaf4f5725e4b3.tar.bz2
JellySolutions-bf33fa3ca9f29b1e75cc077ae2eaaf4f5725e4b3.zip
need list delete button
Diffstat (limited to 'ufund-ui/src/app/components/need-list/need-list.component.ts')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts
index a3eb072..579565c 100644
--- a/ufund-ui/src/app/components/need-list/need-list.component.ts
+++ b/ufund-ui/src/app/components/need-list/need-list.component.ts
@@ -18,4 +18,10 @@ export class NeedListComponent {
ngOnInit(): void {
this.cupboardService.getNeeds().subscribe(n => this.needs = n)
}
+
+ delete(id : number) {
+ this.cupboardService.deleteNeed(id).subscribe(() => {
+ this.needs = this.needs.filter(n => n.id !== id)
+ })
+ }
}