Fix: Product ledger was not totalling. This is because for some reason, pydantic was sending the data as string when the field was nullable
27 lines
791 B
TypeScript
27 lines
791 B
TypeScript
import { HttpClient } 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 { IssueGridItem } from '../core/issue-grid-item';
|
|
|
|
const url = '/api/issue-grid';
|
|
const serviceName = 'IssueGridService';
|
|
|
|
@Injectable({
|
|
providedIn: 'root',
|
|
})
|
|
export class IssueGridService {
|
|
constructor(
|
|
private http: HttpClient,
|
|
private log: ErrorLoggerService,
|
|
) {}
|
|
|
|
issueGrid(date: string): Observable<IssueGridItem[]> {
|
|
return this.http
|
|
.get<IssueGridItem[]>(`${url}/${date}`)
|
|
.pipe(catchError(this.log.handleError(serviceName, 'autocomplete'))) as Observable<IssueGridItem[]>;
|
|
}
|
|
}
|