Fix: Post voucher was not working. Replace command had borked the url.
Fix: Attendace report file name contained single quotes and did not open in excel
This commit is contained in:
parent
1f21438a4c
commit
ccf2f704b6
brewman/brewman/routers
overlord
.eslintrc.json
src
@ -41,7 +41,7 @@ def get_report(
|
||||
output,
|
||||
db,
|
||||
)
|
||||
headers = {"Content-Disposition": "attachment; filename = 'attendance-record.csv'"}
|
||||
headers = {"Content-Disposition": "attachment; filename = attendance-record.csv"}
|
||||
output.seek(0)
|
||||
return StreamingResponse(output, media_type="text/csv", headers=headers)
|
||||
finally:
|
||||
|
@ -37,6 +37,13 @@
|
||||
"style": "camelCase"
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/lines-between-class-members": [
|
||||
"error",
|
||||
"always",
|
||||
{
|
||||
"exceptAfterSingleLine": true
|
||||
}
|
||||
],
|
||||
"import/order": [
|
||||
"error",
|
||||
{
|
||||
@ -46,6 +53,9 @@
|
||||
],
|
||||
"@typescript-eslint/naming-convention": [
|
||||
"off"
|
||||
],
|
||||
"@typescript-eslint/no-explicit-any": [
|
||||
"error"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
@ -19,7 +19,7 @@ export class AttendanceService {
|
||||
return this.http
|
||||
.get<Attendance>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get date as Observable<Attendance>=${date}`)),
|
||||
catchError(this.log.handleError(serviceName, `get date=${date}`)),
|
||||
) as Observable<Attendance>;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ export class ClientService {
|
||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<Client>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id as Observable<Client>=${id}`))) as Observable<Client>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Client>;
|
||||
}
|
||||
|
||||
list(): Observable<Client[]> {
|
||||
|
@ -18,7 +18,7 @@ export class AccountService {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<Account>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id as Observable<Account>=${id}`))) as Observable<Account>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Account>;
|
||||
}
|
||||
|
||||
list(): Observable<Account[]> {
|
||||
|
@ -60,7 +60,7 @@ export class VoucherService {
|
||||
|
||||
post(id: string): Observable<Voucher> {
|
||||
return this.http
|
||||
.post<Voucher>(`${url}/post as Observable<Voucher>-voucher/${id}`, {})
|
||||
.post<Voucher>(`${url}/post-voucher/${id}`, {})
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'Post Voucher'))) as Observable<Voucher>;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ export class CostCentreService {
|
||||
return this.http
|
||||
.get<CostCentre>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id as Observable<CostCentre>=${id}`)),
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||
) as Observable<CostCentre>;
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,7 @@ export class EmployeeAttendanceService {
|
||||
.get<EmployeeAttendance>(getUrl, options)
|
||||
.pipe(
|
||||
catchError(
|
||||
this.log.handleError(serviceName, `get id as Observable<EmployeeAttendance>=${id}`),
|
||||
this.log.handleError(serviceName, `get id=${id}`),
|
||||
),
|
||||
) as Observable<EmployeeAttendance>;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ export class EmployeeService {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<Employee>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id as Observable<Employee>=${id}`))) as Observable<Employee>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Employee>;
|
||||
}
|
||||
|
||||
list(): Observable<Employee[]> {
|
||||
|
@ -20,7 +20,7 @@ export class ProductGroupService {
|
||||
return this.http
|
||||
.get<ProductGroup>(getUrl)
|
||||
.pipe(
|
||||
catchError(this.log.handleError(serviceName, `get id as Observable<ProductGroup>=${id}`)),
|
||||
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||
) as Observable<ProductGroup>;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ export class ProductService {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<Product>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id as Observable<Product>=${id}`))) as Observable<Product>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Product>;
|
||||
}
|
||||
|
||||
list(): Observable<Product[]> {
|
||||
|
@ -20,7 +20,7 @@ export class RoleService {
|
||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||
return this.http
|
||||
.get<Role>(getUrl)
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id as Observable<Role>=${id}`))) as Observable<Role>;
|
||||
.pipe(catchError(this.log.handleError(serviceName, `get id=${id}`))) as Observable<Role>;
|
||||
}
|
||||
|
||||
list(): Observable<Role[]> {
|
||||
|
@ -7,7 +7,16 @@ import {
|
||||
platformBrowserDynamicTesting,
|
||||
} from '@angular/platform-browser-dynamic/testing';
|
||||
|
||||
declare const require: any;
|
||||
declare const require: {
|
||||
context(
|
||||
path: string,
|
||||
deep?: boolean,
|
||||
filter?: RegExp,
|
||||
): {
|
||||
keys(): string[];
|
||||
<T>(id: string): T;
|
||||
};
|
||||
};
|
||||
|
||||
// First, initialize the Angular testing environment.
|
||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
||||
|
Loading…
x
Reference in New Issue
Block a user