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:
@@ -95,7 +95,9 @@ export class EmployeeAttendanceComponent implements OnInit, AfterViewInit {
|
||||
|
||||
ngAfterViewInit() {
|
||||
setTimeout(() => {
|
||||
if (this.employeeElement) this.employeeElement.nativeElement.focus();
|
||||
if (this.employeeElement) {
|
||||
this.employeeElement.nativeElement.focus();
|
||||
}
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,6 @@ import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
|
||||
import { EmployeeAttendance } from './employee-attendance';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
const url = '/api/employee-attendance';
|
||||
const serviceName = 'EmployeeAttendanceService';
|
||||
|
||||
@@ -31,19 +27,21 @@ export class EmployeeAttendanceService {
|
||||
if (finishDate !== null) {
|
||||
options.params = options.params.set('f', finishDate);
|
||||
}
|
||||
return <Observable<EmployeeAttendance>>(
|
||||
this.http
|
||||
.get<EmployeeAttendance>(getUrl, options)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`)))
|
||||
);
|
||||
return this.http
|
||||
.get<EmployeeAttendance>(getUrl, options)
|
||||
.pipe(
|
||||
catchError(
|
||||
this.log.handleError(serviceName, `get id as Observable<EmployeeAttendance>=${id}`),
|
||||
),
|
||||
) as Observable<EmployeeAttendance>;
|
||||
}
|
||||
|
||||
save(employeeAttendance: EmployeeAttendance): Observable<EmployeeAttendance> {
|
||||
const { id } = employeeAttendance.employee;
|
||||
return <Observable<EmployeeAttendance>>(
|
||||
this.http
|
||||
.post<EmployeeAttendance>(`${url}/${id}`, employeeAttendance, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'save')))
|
||||
);
|
||||
return this.http
|
||||
.post<EmployeeAttendance>(`${url}/${id}`, employeeAttendance)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, 'save')),
|
||||
) as Observable<EmployeeAttendance>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user