LP#1929749: use correct method to update LI prices
authorGalen Charlton <gmc@equinoxOLI.org>
Wed, 9 Feb 2022 21:17:05 +0000 (16:17 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Wed, 9 Feb 2022 21:17:05 +0000 (16:17 -0500)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.ts

index 7b5e170..d6bab06 100644 (file)
@@ -679,16 +679,17 @@ export class LineitemListComponent implements OnInit {
     }
 
     liPriceChange(li: IdlObject) {
-        const price = li.estimated_unit_price();
         if (this.liPriceIsValid(li)) {
-            li.estimated_unit_price(Number(price).toFixed(2));
-
+            const price = Number(li.estimated_unit_price()).toFixed(2);
             this.net.request(
                 'open-ils.acq',
-                'open-ils.acq.lineitem.update',
-                this.auth.token(), li
-            ).subscribe(resp =>
-                this.liService.activateStateChange.emit(li.id()));
+                'open-ils.acq.lineitem.price.set',
+                this.auth.token(), li.id(), price
+            ).subscribe(resp => {
+                // update local copy
+                li.estimated_unit_price(price);
+                this.liService.activateStateChange.emit(li.id());
+            });
         }
     }