diff options
author | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-07 14:05:08 -0400 |
---|---|---|
committer | Gunther6070 <haydenhartman10@yahoo.com> | 2025-04-07 14:05:08 -0400 |
commit | ed739c319f2f5e6680fe1a048c9c904b8d7d2429 (patch) | |
tree | 89bff84adf9d2a86aa6178a90d833a6a98fe27b8 /ufund-ui/src/app/components/need-edit/need-edit.component.ts | |
parent | 791dafcf058230f6fe3f3cfbf6ca179e1caeca81 (diff) | |
parent | 80e86d8bb9293f6a76e25e7d1e0f0ac4aa92bf09 (diff) | |
download | JellySolutions-ed739c319f2f5e6680fe1a048c9c904b8d7d2429.tar.gz JellySolutions-ed739c319f2f5e6680fe1a048c9c904b8d7d2429.tar.bz2 JellySolutions-ed739c319f2f5e6680fe1a048c9c904b8d7d2429.zip |
Merge remote-tracking branch 'origin/main'
Diffstat (limited to 'ufund-ui/src/app/components/need-edit/need-edit.component.ts')
-rw-r--r-- | ufund-ui/src/app/components/need-edit/need-edit.component.ts | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/ufund-ui/src/app/components/need-edit/need-edit.component.ts b/ufund-ui/src/app/components/need-edit/need-edit.component.ts index b63d9c1..3c42c34 100644 --- a/ufund-ui/src/app/components/need-edit/need-edit.component.ts +++ b/ufund-ui/src/app/components/need-edit/need-edit.component.ts @@ -39,7 +39,7 @@ export class NeedEditComponent implements OnChanges { id: this.needCopy.id, //system will control this maxGoal: form.maxGoal, type: GoalType[form.type as keyof typeof GoalType], - urgent: form.urgent, + urgent: form.urgent ?? false, filterAttributes: [], current: 0, description: form.description @@ -56,13 +56,7 @@ export class NeedEditComponent implements OnChanges { need.current = this.need?.current ?? 0 this.cupboardService.updateNeed(need.id, need) .pipe(catchError((ex, _) => { - if (ex.status == 500) { - this.toastService.sendToast(ToastType.ERROR, 'Fields cannot be blank'); - } else if (ex.status == 400) { - this.toastService.sendToast(ToastType.ERROR, ex.error); - } else { - this.toastService.sendToast(ToastType.ERROR, "Error on creating need"); - } + this.toastService.sendToast(ToastType.ERROR, ex.error); return of() })) .subscribe( @@ -83,13 +77,7 @@ export class NeedEditComponent implements OnChanges { createNeed(need: Need) { this.cupboardService.createNeed(need) .pipe(catchError((ex, _) => { - if (ex.status == 500) { - this.toastService.sendToast(ToastType.ERROR, "Fields cannot be blank"); - } else if (ex.status == 400) { - this.toastService.sendToast(ToastType.ERROR, ex.error); - } else { - this.toastService.sendToast(ToastType.ERROR, "Error on creating need"); - } + this.toastService.sendToast(ToastType.ERROR, ex.error); return of() })) .subscribe( |