diff options
| author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-18 13:35:09 -0400 | 
|---|---|---|
| committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-03-18 13:35:09 -0400 | 
| commit | c135f56c7b2d0d283ea279fa7934929fb2e09aa3 (patch) | |
| tree | 58197052310b6ea7efdcd218ceb50101c1b7101f /ufund-ui | |
| parent | 72868a3b4026bc8d5c8484487e62027de3baf0bc (diff) | |
| download | JellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.tar.gz JellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.tar.bz2 JellySolutions-c135f56c7b2d0d283ea279fa7934929fb2e09aa3.zip  | |
Modified status codes to properly display error messages on creation and updating of needs
Diffstat (limited to 'ufund-ui')
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 3 | 
1 files changed, 3 insertions, 0 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index 45346b4..13eddad 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -106,6 +106,7 @@ export class CupboardComponent implements OnInit {          console.log(need.id, need, "need updated");          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) { @@ -141,6 +142,7 @@ export class CupboardComponent implements OnInit {          console.log("form submitted. creating need: ", need);          this.cupboardService.createNeed(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) { @@ -203,6 +205,7 @@ let friendlyHttpStatus: { [key: number]: string } = {      416: 'Requested Range Not Satisfiable',      417: 'Expectation Failed',      418: 'I\'m a teapot', +    422: 'Unprocessable Entity',      429: 'Too Many Requests',      500: 'Internal Server Error',      501: 'Not Implemented',  | 
