aboutsummaryrefslogtreecommitdiff
path: root/ufund-ui/src/app/components/cupboard/cupboard.component.ts
diff options
context:
space:
mode:
authorbenal01 <bja4245@rit.edu>2025-03-31 22:15:37 -0400
committerbenal01 <bja4245@rit.edu>2025-03-31 22:15:37 -0400
commit786a6db3f5a22f7bb2cc249731ef654b675c3c86 (patch)
treee45792d92bf263b59fdfecf8a595cc9b7ff899c7 /ufund-ui/src/app/components/cupboard/cupboard.component.ts
parent4f8ddd385924b3c7c2b36acd28daf658ecc2cb09 (diff)
downloadJellySolutions-786a6db3f5a22f7bb2cc249731ef654b675c3c86.tar.gz
JellySolutions-786a6db3f5a22f7bb2cc249731ef654b675c3c86.tar.bz2
JellySolutions-786a6db3f5a22f7bb2cc249731ef654b675c3c86.zip
moving functionality to new component
Diffstat (limited to 'ufund-ui/src/app/components/cupboard/cupboard.component.ts')
-rw-r--r--ufund-ui/src/app/components/cupboard/cupboard.component.ts39
1 files changed, 0 insertions, 39 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
index 662def4..e70d98f 100644
--- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts
+++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts
@@ -82,45 +82,6 @@ export class CupboardComponent implements OnInit {
return type === ("MANAGER" as unknown as userType);
}
- update(form: any) {
- console.log(form);
- const need: Need = {
- name: form.name,
- image: form.image,
- location: form.location,
- id: this.selectedNeed.id, //system will control this
- maxGoal: form.maxGoal,
- type: GoalType[form.type as keyof typeof GoalType],
- urgent: form.urgent,
- filterAttributes: [],
- current: 0,
- description: form.description
- };
-
- 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");
- }
- return of()
- }))
- .subscribe(
- (result) => {
- if (result) {
- console.log("need updated successfully");
- this.needList?.refresh()
- } else {
- console.log("need update failed");
- }
- }
-
- );
- }
-
submit(form: any) {
const need: Need = {
name: form.name,