-
Notifications
You must be signed in to change notification settings - Fork 0
/
waiters.service.ts
29 lines (23 loc) · 1011 Bytes
/
waiters.service.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import {Injectable} from '@angular/core';
import {HttpService} from './http.service';
import {AbstractModelService} from './abstract-model.service';
import {WaiterModel} from '../_models/waiter.model';
import {OrganisationsService} from './organisations.service';
@Injectable({
providedIn: 'root',
})
export class WaitersService extends AbstractModelService<WaiterModel> {
constructor(httpService: HttpService, private organisationService: OrganisationsService) {
super(httpService, '/config/waiter');
this.setGetAllUrl('/config/table?event_id=' + this.organisationService.getSelected()?.id);
this.organisationService.selectedChange.subscribe((org) => {
this.setGetAllUrl('/config/waiter?organisation_id=' + org?.id);
});
}
public setSelectedOrganisationGetAllUrl(): void {
this.setGetAllUrl('/config/waiter?organisation_id=' + this.organisationService.getSelected()?.id);
}
protected convert(jsonData: any): WaiterModel {
return new WaiterModel(jsonData);
}
}