diff options
author | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-03-18 16:53:39 -0400 |
---|---|---|
committer | Akash Keshav <112591754+domesticchores@users.noreply.github.com> | 2025-03-18 16:53:39 -0400 |
commit | 81b93fc671ba35d67c414937e18b686fd6d5f861 (patch) | |
tree | e19ad608e4d27a5c5f6620ce41aa1b53a99f4274 /ufund-ui/src/app/components/funding-basket | |
parent | 9d90b2a29b1f47b6271fd9ea87989a4195cf5ee6 (diff) | |
download | JellySolutions-81b93fc671ba35d67c414937e18b686fd6d5f861.tar.gz JellySolutions-81b93fc671ba35d67c414937e18b686fd6d5f861.tar.bz2 JellySolutions-81b93fc671ba35d67c414937e18b686fd6d5f861.zip |
idk but it works. funding basket worsk. -ak
Diffstat (limited to 'ufund-ui/src/app/components/funding-basket')
-rw-r--r-- | ufund-ui/src/app/components/funding-basket/funding-basket.component.ts | 45 |
1 files changed, 21 insertions, 24 deletions
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 Observable<string>(); - })) - .subscribe( - (result) => { - if (result) { - console.log("need updated successfully"); - //this.needList?.refresh() - } else { - console.log("need update failed"); - } - } - - ); + .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 Observable<string>(); + })) + .subscribe((result) => { + if (result) { + console.log('need updated successfully'); + //this.needList?.refresh() + } else { + console.log('need update failed'); + } + }); } } } |