{{need.name}}
-
+
+ (click)="this.usersService.removeNeed(need.id)">Remove Need
|
Goal: {{need.maxGoal}}
+Current: {{need.current}}
+How much to Contribute:
@@ -18,20 +18,14 @@ |
---|
-
- {{need.name}}
-
+ {{need.name}}
Goal: {{need.maxGoal}} Current: {{need.current}} -How much to Contribute: -
-
-
+ How much to Contribute:
-
+
|
Invalid input in funding basket!
+Invalid input in funding basket!
+ {{statusText | async}}Goal: {{need?.maxGoal}}
Current: {{need?.current}}
-This goal is {{((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)}}% complete!
\ No newline at end of file +This goal is {{(((need?.current ?? 0)*100) / (need?.maxGoal ?? 0)).toFixed(0)}}% complete!
\ No newline at end of file -- cgit v1.2.3 From 81b93fc671ba35d67c414937e18b686fd6d5f861 Mon Sep 17 00:00:00 2001 From: Akash Keshav <112591754+domesticchores@users.noreply.github.com> Date: Tue, 18 Mar 2025 16:53:39 -0400 Subject: idk but it works. funding basket worsk. -ak --- .../funding-basket/funding-basket.component.ts | 45 ++++++++++------------ 1 file changed, 21 insertions(+), 24 deletions(-) (limited to 'ufund-ui/src/app/components') diff --git a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts index 7f086ec..66b9fd1 100644 --- a/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts +++ b/ufund-ui/src/app/components/funding-basket/funding-basket.component.ts @@ -42,7 +42,7 @@ export class FundingBasketComponent implements OnInit { let contribution = c as HTMLInputElement; console.log(contribution.value, contribution.id); contribution.setAttribute("style",""); - if ( contribution.value == '' || contribution.valueAsNumber < 0) { + if ( contribution.value == '' || contribution.valueAsNumber <= 0) { this.isValid = false; contribution.setAttribute("style","color: #ff0000"); } @@ -53,30 +53,27 @@ export class FundingBasketComponent implements OnInit { let need = await firstValueFrom(this.cupboardService.getNeed(+contribution.id)); need.current +=+ contribution.value; console.log(need); - this.usersService.removeNeed(need.id); + this.usersService.removeNeed(+need.id); this.cupboardService.updateNeed(need.id, need) - .pipe(catchError((ex, r) => { - console.log(ex.status); - if (ex.status == 500) { - this.statusText.next("Fields cannot be blank"); - } else if (ex.status == 400) { - this.statusText.next("Goal must be greater than 0"); - } else { - this.statusText.next("Error on creating need"); - } - return new ObservableGoal: {{need.maxGoal}}
-Current: {{need.current}}
-How much to Contribute:
+Current: {{(need.current).toFixed(2)}}
+How much to Contribute: