6be1dd5a3a
---- Pending * Table width for the points column in incentive * Linting * keyboard navigation where it was used earlier * can remove the unused totals calculated serverside in productledger * spinner and loading bars * Activate Guard for Employee Function tabs * Progress for Fingerprint uploads * deleted reconcile and receipe features as they were not being used * focus the right control on component load
32 lines
905 B
TypeScript
32 lines
905 B
TypeScript
import {Injectable} from '@angular/core';
|
|
import {catchError} from 'rxjs/operators';
|
|
import {Observable} from 'rxjs/internal/Observable';
|
|
import {HttpClient, HttpHeaders} from '@angular/common/http';
|
|
import {ClosingStock} from './closing-stock';
|
|
import {ErrorLoggerService} from '../core/error-logger.service';
|
|
|
|
const httpOptions = {
|
|
headers: new HttpHeaders({'Content-Type': 'application/json'})
|
|
};
|
|
|
|
const url = '/api/ClosingStock';
|
|
const serviceName = 'AccountService';
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ClosingStockService {
|
|
|
|
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
|
}
|
|
|
|
list(date: string): Observable<ClosingStock> {
|
|
const listUrl = (date === null) ? url : `${url}/${date}`;
|
|
return <Observable<ClosingStock>>this.http.get<ClosingStock>(listUrl)
|
|
.pipe(
|
|
catchError(this.log.handleError(serviceName, 'list'))
|
|
);
|
|
}
|
|
|
|
}
|