aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-page/need-page.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ufund-ui/src/app/components/need-page/need-page.component.ts')
-rw-r--r--ufund-ui/src/app/components/need-page/need-page.component.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/ufund-ui/src/app/components/need-page/need-page.component.ts b/ufund-ui/src/app/components/need-page/need-page.component.ts
index 17e330c..67dae83 100644
--- a/ufund-ui/src/app/components/need-page/need-page.component.ts
+++ b/ufund-ui/src/app/components/need-page/need-page.component.ts
@@ -14,18 +14,21 @@ import {ModalService} from '../../services/modal.service';
templateUrl: './need-page.component.html',
styleUrl: './need-page.component.css'
})
+
export class NeedPageComponent implements OnInit {
+
constructor(
private route: ActivatedRoute,
private cupboardService: CupboardService,
private authService: AuthService,
protected usersService: UsersService,
private toastService: ToastsService,
- private router: Router,
+ protected router: Router,
protected modalService: ModalService
) {}
@Input() need!: Need;
+ warned: boolean = false;
ngOnInit(): void {
const id = Number(this.route.snapshot.paramMap.get('id'));
@@ -44,6 +47,8 @@ export class NeedPageComponent implements OnInit {
return of();
}))
.subscribe(() => {
+ let action = {label: "View Basket", onAction: () => this.router.navigate(['/basket'])}
+ this.toastService.sendToast(ToastType.INFO, `"${need.name}" Added to basket`, action)
this.usersService.refreshBasket();
});
} else {