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

@ -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>;
}
}