Simplified some permissions
Renamed Accounts Audit to Audit Renamed Machines to Devices as it made sense Sections and Tables are now under Sections Permission Guest Book is now under Customers Permission Renamed Beer Consumption Report to Beer Sale Report Fix: Move Kot and Table to check what the final effect is
This commit is contained in:
33
bookie/src/app/beer-sale-report/beer-sale-report.service.ts
Normal file
33
bookie/src/app/beer-sale-report/beer-sale-report.service.ts
Normal file
@ -0,0 +1,33 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { BeerSaleReport } from './beer-sale-report';
|
||||
|
||||
const url = '/api/beer-sale-report';
|
||||
const serviceName = 'BeerSaleReportService';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class BeerSaleReportService {
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
get(startDate: string, finishDate): Observable<BeerSaleReport> {
|
||||
const options = { params: new HttpParams() };
|
||||
if (startDate !== null) {
|
||||
options.params = options.params.set('s', startDate);
|
||||
}
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return <Observable<BeerSaleReport>>(
|
||||
this.http
|
||||
.get<BeerSaleReport>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'get')))
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user