From 45bb79cd56e93ee26f1227ed15a9161a59fe6f35 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Tue, 18 Mar 2025 12:55:16 -0400 Subject: Fixed logic on status checks --- ufund-ui/src/app/components/cupboard/cupboard.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index 6ad0a5f..45346b4 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -106,9 +106,9 @@ export class CupboardComponent implements OnInit { console.log(need.id, need, "need updated"); this.cupboardService.updateNeed(need.id, need) .pipe(catchError((ex, r) => { - if (ex.status = 500) { + if (ex.status == 500) { this.statusText.next("Fields cannot be blank"); - } else if (ex.status = 400) { + } else if (ex.status == 400) { this.statusText.next("Goal must be greater than 0"); } else { this.statusText.next("Error on creating need"); @@ -141,9 +141,9 @@ export class CupboardComponent implements OnInit { console.log("form submitted. creating need: ", need); this.cupboardService.createNeed(need) .pipe(catchError((ex, r) => { - if (ex.status = 500) { + if (ex.status == 500) { this.statusText.next("Fields cannot be blank"); - } else if (ex.status = 400) { + } else if (ex.status == 400) { this.statusText.next("Goal must be greater than 0"); } else { this.statusText.next("Error on creating need"); -- cgit v1.2.3