aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/need-list
diff options
context:
space:
mode:
authorGunther6070 <haydenhartman10@yahoo.com>2025-04-02 16:08:52 -0400
committerGunther6070 <haydenhartman10@yahoo.com>2025-04-02 16:08:52 -0400
commit4d382ccf9de889e4b339dd13220c3f761497e419 (patch)
tree9702d0171001bb76d4d63824bee6eee3502d5ff1 /ufund-ui/src/app/components/need-list
parent6b7c830eeefb6a6a28136a3faacf7713953a6138 (diff)
downloadJellySolutions-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')
-rw-r--r--ufund-ui/src/app/components/need-list/need-list.component.ts9
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;
}