Files
brewman/overlord/src/app/issue/issue-grid.service.ts
T
tanshu ac868257b7 Chore: Reformatted everthing
Fix: Product ledger was not totalling.
This is because for some reason, pydantic was sending the data as string when the field was nullable
2023-08-04 21:00:26 +05:30

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[]>;
}
}