1 import {Injectable} from '@angular/core';
2 import {Router} from '@angular/router';
3 import {PcrudService} from '@eg/core/pcrud.service';
5 // Some grid actions that are shared across booking grids
7 @Injectable({providedIn: 'root'})
8 export class ReservationActionsService {
11 private pcrud: PcrudService,
12 private router: Router,
16 manageReservationsByResource = (barcode: string) => {
17 this.router.navigate(['/staff', 'booking', 'manage_reservations', 'by_resource', barcode]);
20 viewItemStatus = (barcode: string) => {
21 this.pcrud.search('acp', { 'barcode': barcode }, { limit: 1 })
23 window.open('/eg/staff/cat/item/' + acp.id());
27 notOneUniqueSelected = (ids: number[]) => {
28 return (new Set(ids).size !== 1);