2 * Common code for mananging holdings
4 import {Injectable, EventEmitter} from '@angular/core';
5 import {NetService} from '@eg/core/net.service';
7 interface NewVolumeData {
13 export class HoldingsService {
15 constructor(private net: NetService) {}
17 // Open the holdings editor UI in a new browser window/tab.
19 recordId: number, // Bib record ID
20 addToVols: number[] = [], // Add copies to existing volumes
21 volumeData: NewVolumeData[] = []) { // Creating new volumes
23 const raw: any[] = [];
26 addToVols.forEach(volId => raw.push({callnumber: volId}));
27 } else if (volumeData) {
28 volumeData.forEach(data => raw.push(data));
31 if (raw.length === 0) { raw.push({}); }
35 'open-ils.actor.anon_cache.set_value',
36 null, 'edit-these-copies', {
45 console.error('Could not create holds cache key!');
49 const url = `/eg/staff/cat/volcopy/${key}`;
50 window.open(url, '_blank');