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:
tanshu committed 2020-12-08 12:09:19 +05:30
1 parent d5048bc455
commit 57ef355170
176 files changed
+940 -831

No files matched your search

+29 -35
View File
@@ -16,29 +16,29 @@ export class SettingsService {
getLockInformation(): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<LockInfo>>(
this.http
.get<LockInfo>(url)
.pipe(catchError(this.log.handleError(serviceName, 'getLockInformation')))
);
return this.http
.get<LockInfo>(url)
.pipe(
catchError(this.log.handleError(serviceName, 'getLockInformation')),
) as Observable<LockInfo>;
}
setLockInformation(lockInformation: LockInfo): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<LockInfo>>(
this.http
.post<LockInfo>(url, lockInformation)
.pipe(catchError(this.log.handleError(serviceName, 'setLockInformation')))
);
return this.http
.post<LockInfo>(url, lockInformation)
.pipe(
catchError(this.log.handleError(serviceName, 'setLockInformation')),
) as Observable<LockInfo>;
}
deleteLockInformation(): Observable<LockInfo> {
const url = '/api/lock-information';
return <Observable<LockInfo>>(
this.http
.delete<LockInfo>(url)
.pipe(catchError(this.log.handleError(serviceName, 'deleteLockInformation')))
);
return this.http
.delete<LockInfo>(url)
.pipe(
catchError(this.log.handleError(serviceName, 'deleteLockInformation')),
) as Observable<LockInfo>;
}
resetStock(
@@ -48,42 +48,36 @@ export class SettingsService {
quantity: number,
): Observable<boolean> {
const url = '/api/reset-stock';
return <Observable<boolean>>this.http
return this.http
.post<boolean>(`${url}/${product.id}`, { stockDate, resetDate, quantity })
.pipe(catchError(this.log.handleError(serviceName, 'resetStock')));
.pipe(catchError(this.log.handleError(serviceName, 'resetStock'))) as Observable<boolean>;
}
rebaseDatabase(date: string): Observable<{}> {
rebaseDatabase(date: string): Observable<Record<string, never>> {
const url = '/api/rebase';
return <Observable<{}>>(
this.http
.post<{}>(`${url}/${date}`, {})
.pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase')))
);
return this.http
.post<Record<string, never>>(`${url}/${date}`, {})
.pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase'))) as Observable<Record<string, never>>;
}
setMaintenance(enable: boolean): Observable<{ enabled: boolean; user: string }> {
const url = '/api/maintenance';
return <Observable<{ enabled: boolean; user: string }>>this.http
return this.http
.post<{ enabled: boolean; user: string }>(url, { enabled: enable })
.pipe(catchError(this.log.handleError(serviceName, 'setMaintenance')));
.pipe(catchError(this.log.handleError(serviceName, 'setMaintenance'))) as Observable<{ enabled: boolean; user: string }>;
}
getMaintenance(): Observable<{ enabled: boolean; user: string }> {
const url = '/api/maintenance';
return <Observable<{ enabled: boolean; user: string }>>(
this.http
return this.http
.get<{ enabled: boolean; user: string }>(url)
.pipe(catchError(this.log.handleError(serviceName, 'getMaintenance')))
);
.pipe(catchError(this.log.handleError(serviceName, 'getMaintenance'))) as Observable<{ enabled: boolean; user: string }>;
}
checkDatabaseIntegrity(): Observable<{ 'Duplicate Attendances Fixed': number }> {
checkDatabaseIntegrity(): Observable<{ 'attendanceCount': number }> {
const url = '/api/db-integrity';
return <Observable<{ 'Duplicate Attendances Fixed': number }>>(
this.http
.post<{ 'Duplicate Attendances Fixed': number }>(url, {})
.pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity')))
);
return this.http
.post<{ 'attendanceCount': number }>(url, {})
.pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity'))) as Observable<{ 'attendanceCount': number }>;
}
}