From e9950afde68bb6e5e659ac182334bf2b18088f90 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Mon, 17 Mar 2025 22:49:37 -0400 Subject: Added status message when update need fails --- ufund-ui/src/app/components/cupboard/cupboard.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index 4088ae4..1b6d658 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -101,7 +101,12 @@ needs: any; }; console.log("need:", need); console.log(need.id, need, "need updated"); - this.cupboardService.updateNeed(need.id, need).subscribe( + this.cupboardService.updateNeed(need.id, need) + .pipe(catchError((ex, r) => { + this.statusText.next("Max goal must be greater than 0 " + friendlyHttpStatus[ex.status]) + return of() + })) + .subscribe( (result) => { if (result) { console.log("need updated successfully"); -- cgit v1.2.3