Fix: Login deleting old clients was conflicting with login history

Chore: Moved to angular linting using the recommended plugins / settings
This commit is contained in:
2020-12-08 12:09:19 +05:30
parent d5048bc455
commit 57ef355170
176 changed files with 940 additions and 831 deletions

View File

@ -1,5 +1,5 @@
import { inject, TestBed } from '@angular/core/testing';
import { HttpClientModule } from '@angular/common/http';
import { inject, TestBed } from '@angular/core/testing';
import { AttendanceResolver } from './attendance-resolver.service';

View File

@ -15,10 +15,8 @@ export class AttendanceTypeService {
constructor(private http: HttpClient, private log: ErrorLoggerService) {}
list(): Observable<AttendanceType[]> {
return <Observable<AttendanceType[]>>(
this.http
.get<AttendanceType[]>(url)
.pipe(catchError(this.log.handleError(serviceName, 'list')))
);
return this.http
.get<AttendanceType[]>(url)
.pipe(catchError(this.log.handleError(serviceName, 'list'))) as Observable<AttendanceType[]>;
}
}

View File

@ -1,6 +1,6 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { MatDialogModule } from '@angular/material/dialog';
import { ReactiveFormsModule } from '@angular/forms';
import { MatDialogModule } from '@angular/material/dialog';
import { RouterTestingModule } from '@angular/router/testing';
import { AttendanceComponent } from './attendance.component';

View File

@ -1,5 +1,5 @@
import { inject, TestBed } from '@angular/core/testing';
import { HttpClientModule } from '@angular/common/http';
import { inject, TestBed } from '@angular/core/testing';
import { AttendanceService } from './attendance.service';

View File

@ -7,10 +7,6 @@ import { ErrorLoggerService } from '../core/error-logger.service';
import { Attendance } from './attendance';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
};
const url = '/api/attendance';
const serviceName = 'AttendanceService';
@ -20,18 +16,16 @@ export class AttendanceService {
get(date: string | null): Observable<Attendance> {
const getUrl: string = date === null ? url : `${url}/${date}`;
return <Observable<Attendance>>(
this.http
.get<Attendance>(getUrl)
.pipe(catchError(this.log.handleError(serviceName, `get date=${date}`)))
);
return this.http
.get<Attendance>(getUrl)
.pipe(
catchError(this.log.handleError(serviceName, `get date as Observable<Attendance>=${date}`)),
) as Observable<Attendance>;
}
save(attendance: Attendance): Observable<Attendance> {
return <Observable<Attendance>>(
this.http
.post<Attendance>(`${url}/${attendance.date}`, attendance, httpOptions)
.pipe(catchError(this.log.handleError(serviceName, 'save')))
);
return this.http
.post<Attendance>(`${url}/${attendance.date}`, attendance)
.pipe(catchError(this.log.handleError(serviceName, 'save'))) as Observable<Attendance>;
}
}