Blacked and isorted the python files

Prettied and eslinted the typescript/html files
This commit is contained in:
2020-10-11 10:56:29 +05:30
parent b31db593c2
commit d677cfb1ea
505 changed files with 7560 additions and 5650 deletions

View File

@ -1,54 +1,49 @@
import { HttpClient, HttpParams } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { catchError } from 'rxjs/operators';
import { Observable } from 'rxjs/internal/Observable';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { CashierReport } from './cashier-report';
import { catchError } from 'rxjs/operators';
import { ErrorLoggerService } from '../core/error-logger.service';
import { User } from '../core/user';
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
};
import { CashierReport } from './cashier-report';
const url = '/api/cashier-report';
const serviceName = 'CashierReportService';
@Injectable({
providedIn: 'root'
providedIn: 'root',
})
export class CashierReportService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {
}
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
list(id: string, startDate: string, finishDate): Observable<CashierReport> {
const listUrl = (id === null) ? url : `${url}/${id}`;
const options = {params: new HttpParams()};
const listUrl = id === null ? url : `${url}/${id}`;
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<CashierReport>>this.http.get<CashierReport>(listUrl, options)
.pipe(
catchError(this.log.handleError(serviceName, 'list'))
);
return <Observable<CashierReport>>(
this.http
.get<CashierReport>(listUrl, options)
.pipe(catchError(this.log.handleError(serviceName, 'list')))
);
}
activeCashiers(startDate: string, finishDate): Observable<User[]> {
const options = {params: new HttpParams()};
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<User[]>>this.http.get<User[]>(`${url}/active`, options)
return <Observable<User[]>>this.http
.get<User[]>(`${url}/active`, options)
.pipe(
catchError(this.log.handleError(serviceName, 'activeCashiers'))
);
.pipe(catchError(this.log.handleError(serviceName, 'activeCashiers')));
}
}