Moved from tslint to eslint as tslint was depreciated.
Added prettier and also prettied all the typescript files using prettier ESLint is using the AirBnB rules which are the most strict to lint the files.
This commit is contained in:
@ -1,24 +1,23 @@
|
||||
import {Injectable} from '@angular/core';
|
||||
import {Observable} from 'rxjs/internal/Observable';
|
||||
import {catchError} from 'rxjs/operators';
|
||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||
import {Batch} from './voucher';
|
||||
import {ErrorLoggerService} from './error-logger.service';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Batch } from './voucher';
|
||||
import { ErrorLoggerService } from './error-logger.service';
|
||||
|
||||
const url = '/api/batch';
|
||||
const serviceName = 'BatchService';
|
||||
|
||||
@Injectable({providedIn: 'root'})
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class BatchService {
|
||||
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {
|
||||
}
|
||||
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
|
||||
|
||||
autocomplete(date: string, term: string): Observable<Batch[]> {
|
||||
const options = {params: new HttpParams().set('q', term).set('d', date)};
|
||||
return <Observable<Batch[]>>this.http.get<Batch[]>(url, options)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'autocomplete'))
|
||||
);
|
||||
const options = { params: new HttpParams().set('q', term).set('d', date) };
|
||||
return <Observable<Batch[]>>(
|
||||
this.http
|
||||
.get<Batch[]>(url, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'autocomplete')))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user