Prettied, Linted and updated angular.json according to the latest schematic of Angular CLI.
Now all that is needed is to make it ready for strict compiling. Removed eslint-plugin-prettier as it is not recommended and causes errors for both eslint and prettier Bumped to v8.0.0
This commit is contained in:
1 parent
438a98334d
commit
5ea09df272
320 files changed
+2233
-2268
No files matched your search
@@ -1,14 +1,11 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs/internal/Observable';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
|
||||
import { ErrorLoggerService } from '../core/error-logger.service';
|
||||
import { Product } from '../core/product';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
const serviceName = 'SettingsService';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
@@ -20,7 +17,7 @@ export class SettingsService {
|
||||
return <Observable<any>>(
|
||||
this.http
|
||||
.get<any>(url)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `getLockInformation`)))
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'getLockInformation')))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -29,7 +26,7 @@ export class SettingsService {
|
||||
return <Observable<any>>(
|
||||
this.http
|
||||
.post<any>(url, lockInformation)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `setLockInformation`)))
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'setLockInformation')))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,7 +35,7 @@ export class SettingsService {
|
||||
return <Observable<any>>(
|
||||
this.http
|
||||
.delete<any>(url)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `deleteLockInformation`)))
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'deleteLockInformation')))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -49,13 +46,9 @@ export class SettingsService {
|
||||
quantity: number,
|
||||
): Observable<boolean> {
|
||||
const url = '/api/reset-stock';
|
||||
return <Observable<any>>this.http
|
||||
.post<any>(`${url}/${product.id}`, {
|
||||
stockDate: stockDate,
|
||||
resetDate: resetDate,
|
||||
quantity: quantity,
|
||||
})
|
||||
.pipe(catchError(this.log.handleError(serviceName, `resetStock`)));
|
||||
return this.http
|
||||
.post<any>(`${url}/${product.id}`, { stockDate, resetDate, quantity })
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'resetStock')));
|
||||
}
|
||||
|
||||
rebaseDatabase(date: string): Observable<boolean> {
|
||||
@@ -63,21 +56,21 @@ export class SettingsService {
|
||||
return <Observable<any>>(
|
||||
this.http
|
||||
.post<any>(`${url}/${date}`, {})
|
||||
.pipe(catchError(this.log.handleError(serviceName, `rebaseDatabase`)))
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'rebaseDatabase')))
|
||||
);
|
||||
}
|
||||
|
||||
setMaintenance(enable: boolean): Observable<any> {
|
||||
const url = '/api/maintenance';
|
||||
return <Observable<any>>this.http
|
||||
return this.http
|
||||
.post<any>(url, { enabled: enable })
|
||||
.pipe(catchError(this.log.handleError(serviceName, `setMaintenance`)));
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'setMaintenance')));
|
||||
}
|
||||
|
||||
getMaintenance(): Observable<any> {
|
||||
const url = '/api/maintenance';
|
||||
return <Observable<any>>(
|
||||
this.http.get<any>(url).pipe(catchError(this.log.handleError(serviceName, `getMaintenance`)))
|
||||
this.http.get<any>(url).pipe(catchError(this.log.handleError(serviceName, 'getMaintenance')))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -86,7 +79,7 @@ export class SettingsService {
|
||||
return <Observable<any>>(
|
||||
this.http
|
||||
.post<any>(url, {})
|
||||
.pipe(catchError(this.log.handleError(serviceName, `checkDatabaseIntegrity`)))
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'checkDatabaseIntegrity')))
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user