diff options
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.ts | 13 |
1 files changed, 7 insertions, 6 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 47114c3..7a9d647 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 @@ -1,11 +1,11 @@ -import {Component , Output, EventEmitter} from '@angular/core'; -import { NgForm } from '@angular/forms'; +import {Component, EventEmitter, Output} from '@angular/core'; import {Need} from '../../models/Need'; import {CupboardService} from '../../services/cupboard.service'; -import { UsersService } from '../../services/users.service'; -import { userType } from '../../models/User'; +import {UsersService} from '../../services/users.service'; +import {userType} from '../../models/User'; import {AuthService} from '../../services/auth.service'; import {catchError, of} from 'rxjs'; +import {ToastsService, ToastType} from '../../services/toasts.service'; interface sortAlgo { (a: Need,b: Need): number; @@ -84,7 +84,8 @@ export class NeedListComponent { constructor( private cupboardService: CupboardService, private usersService: UsersService, - private authService: AuthService + private authService: AuthService, + private toastService: ToastsService ) {} refresh() { @@ -196,7 +197,7 @@ export class NeedListComponent { this.usersService.refreshBasket(); }); } else { - window.alert("This need is already in your basket!") + this.toastService.sendToast(ToastType.ERROR, "This need is already in your basket!") } |