diff options
| author | benal01 <bja4245@rit.edu> | 2025-03-26 19:12:52 -0400 | 
|---|---|---|
| committer | benal01 <bja4245@rit.edu> | 2025-03-26 19:12:52 -0400 | 
| commit | d5ae670dbce9e5cabbd594759df490176fd8cecd (patch) | |
| tree | 4816ce78bc2c198ecac8a0c99e69cc71b21ca9ab /ufund-ui/src/app | |
| parent | 959aa5101fbba55f20eda46d02addd27a74cf950 (diff) | |
| download | JellySolutions-d5ae670dbce9e5cabbd594759df490176fd8cecd.tar.gz JellySolutions-d5ae670dbce9e5cabbd594759df490176fd8cecd.tar.bz2 JellySolutions-d5ae670dbce9e5cabbd594759df490176fd8cecd.zip  | |
use selected id for the update form
Diffstat (limited to 'ufund-ui/src/app')
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.html | 1 | ||||
| -rw-r--r-- | ufund-ui/src/app/components/cupboard/cupboard.component.ts | 5 | 
2 files changed, 2 insertions, 4 deletions
diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.html b/ufund-ui/src/app/components/cupboard/cupboard.component.html index 4b76f25..d54eed9 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.html +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.html @@ -29,7 +29,6 @@          <h1> Update Need </h1>          <label>Needs:</label><br>          <form #updateForm="ngForm" (ngSubmit)="update(updateForm.value)"> -            <label>Currently Editing : need.name</label><br>              <input type="text" name="name" [(ngModel)]="selectedNeed.name"><br>              <label>Max Goal:</label><br>              <input type="number" name="maxGoal" [(ngModel)]="selectedNeed.maxGoal"><br> diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index 0d2c1f5..a8b9c14 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -79,14 +79,13 @@ export class CupboardComponent implements OnInit {          console.log(form);          const need: Need = {              name: form.name, -            id: form.id, //system will control this +            id: this.selectedNeed.id, //system will control this              maxGoal: form.maxGoal,              type: GoalType[form.type as keyof typeof GoalType],              filterAttributes: [],              current: 0          }; -        console.log("need:", need); -        console.log(need.id, need, "need updated"); +                 this.cupboardService.updateNeed(need.id, need)              .pipe(catchError((ex, r) => {                  if (ex.status == 500) {  | 
