diff options
author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-02 16:08:52 -0400 |
---|---|---|
committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-02 16:08:52 -0400 |
commit | 4d382ccf9de889e4b339dd13220c3f761497e419 (patch) | |
tree | 9702d0171001bb76d4d63824bee6eee3502d5ff1 /ufund-ui/src/app/components/need-list/need-list.component.ts | |
parent | 6b7c830eeefb6a6a28136a3faacf7713953a6138 (diff) | |
download | JellySolutions-4d382ccf9de889e4b339dd13220c3f761497e419.tar.gz JellySolutions-4d382ccf9de889e4b339dd13220c3f761497e419.tar.bz2 JellySolutions-4d382ccf9de889e4b339dd13220c3f761497e419.zip |
Added dollar signs and other small additions to needs
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 | 9 |
1 files changed, 8 insertions, 1 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 06a612e..2ec850e 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,5 +1,5 @@ import {Component, EventEmitter, Output} from '@angular/core'; -import {Need} from '../../models/Need'; +import {GoalType, Need} from '../../models/Need'; import {CupboardService} from '../../services/cupboard.service'; import {UsersService} from '../../services/users.service'; import {userType} from '../../models/User'; @@ -72,6 +72,10 @@ export class NeedListComponent { itemsPerPage: number = 5; totalPages: number = Math.ceil(this.needs.length / this.itemsPerPage); + getPrefix(need: Need) { + return (need.type === GoalType.MONETARY) ? "$" : ""; + } + decrementPage() { this.currentPage--; this.updateVisibleNeeds(); @@ -229,6 +233,7 @@ export class NeedListComponent { if (currentUser) { if (!currentUser.basket.includes(need.id)) { currentUser.basket.push(need.id); + this.toastService.sendToast(ToastType.INFO, "Need added to your basket!") this.usersService.updateUser(currentUser) .pipe(catchError((err, _) => { console.error(err); @@ -278,5 +283,7 @@ export class NeedListComponent { button.style.visibility = 'hidden'; } } + + protected readonly GoalType = GoalType; } |