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:
@ -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';
|
||||
|
||||
|
||||
@ -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[]>;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user