LP1849523 Ang cat holds batch retrieval
authorBill Erickson <berickxx@gmail.com>
Tue, 22 Oct 2019 15:31:14 +0000 (11:31 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 27 Oct 2021 15:52:03 +0000 (11:52 -0400)
Angular catalog leverages the new batch versions of the bib / metabib
hold counts API to reduce the number of API calls needed per results
page.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/catalog/bib-record.service.ts

index a4dd0b0..b7f7364 100644 (file)
@@ -175,6 +175,17 @@ export class BibRecordService {
             return summary;
         }));
     }
+
+    // Batch hold counts lookup.
+    getHoldCounts(targetIds: number[], isMetarecord?: boolean):
+        Observable<{[id: string]: number}> {
+
+        const method = isMetarecord ?
+            'open-ils.circ.mmr.holds.count.batch' :
+            'open-ils.circ.bre.holds.count.batch';
+
+        return this.net.request('open-ils.circ', method, targetIds);
+    }
 }