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:
@ -41,7 +41,7 @@ def get_report(
|
|||||||
output,
|
output,
|
||||||
db,
|
db,
|
||||||
)
|
)
|
||||||
headers = {"Content-Disposition": "attachment; filename = 'attendance-record.csv'"}
|
headers = {"Content-Disposition": "attachment; filename = attendance-record.csv"}
|
||||||
output.seek(0)
|
output.seek(0)
|
||||||
return StreamingResponse(output, media_type="text/csv", headers=headers)
|
return StreamingResponse(output, media_type="text/csv", headers=headers)
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
@ -37,6 +37,13 @@
|
|||||||
"style": "camelCase"
|
"style": "camelCase"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"@typescript-eslint/lines-between-class-members": [
|
||||||
|
"error",
|
||||||
|
"always",
|
||||||
|
{
|
||||||
|
"exceptAfterSingleLine": true
|
||||||
|
}
|
||||||
|
],
|
||||||
"import/order": [
|
"import/order": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
@ -46,6 +53,9 @@
|
|||||||
],
|
],
|
||||||
"@typescript-eslint/naming-convention": [
|
"@typescript-eslint/naming-convention": [
|
||||||
"off"
|
"off"
|
||||||
|
],
|
||||||
|
"@typescript-eslint/no-explicit-any": [
|
||||||
|
"error"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -19,7 +19,7 @@ export class AttendanceService {
|
|||||||
return this.http
|
return this.http
|
||||||
.get<Attendance>(getUrl)
|
.get<Attendance>(getUrl)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.log.handleError(serviceName, `get date as Observable<Attendance>=${date}`)),
|
catchError(this.log.handleError(serviceName, `get date=${date}`)),
|
||||||
) as Observable<Attendance>;
|
) as Observable<Attendance>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class ClientService {
|
|||||||
const getUrl: string = id === null ? url : `${url}/${id}`;
|
const getUrl: string = id === null ? url : `${url}/${id}`;
|
||||||
return this.http
|
return this.http
|
||||||
.get<Client>(getUrl)
|
.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[]> {
|
list(): Observable<Client[]> {
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class AccountService {
|
|||||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||||
return this.http
|
return this.http
|
||||||
.get<Account>(getUrl)
|
.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[]> {
|
list(): Observable<Account[]> {
|
||||||
|
|||||||
@ -60,7 +60,7 @@ export class VoucherService {
|
|||||||
|
|
||||||
post(id: string): Observable<Voucher> {
|
post(id: string): Observable<Voucher> {
|
||||||
return this.http
|
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>;
|
.pipe(catchError(this.log.handleError(serviceName, 'Post Voucher'))) as Observable<Voucher>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class CostCentreService {
|
|||||||
return this.http
|
return this.http
|
||||||
.get<CostCentre>(getUrl)
|
.get<CostCentre>(getUrl)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.log.handleError(serviceName, `get id as Observable<CostCentre>=${id}`)),
|
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||||
) as Observable<CostCentre>;
|
) as Observable<CostCentre>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export class EmployeeAttendanceService {
|
|||||||
.get<EmployeeAttendance>(getUrl, options)
|
.get<EmployeeAttendance>(getUrl, options)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(
|
catchError(
|
||||||
this.log.handleError(serviceName, `get id as Observable<EmployeeAttendance>=${id}`),
|
this.log.handleError(serviceName, `get id=${id}`),
|
||||||
),
|
),
|
||||||
) as Observable<EmployeeAttendance>;
|
) as Observable<EmployeeAttendance>;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export class EmployeeService {
|
|||||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||||
return this.http
|
return this.http
|
||||||
.get<Employee>(getUrl)
|
.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[]> {
|
list(): Observable<Employee[]> {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class ProductGroupService {
|
|||||||
return this.http
|
return this.http
|
||||||
.get<ProductGroup>(getUrl)
|
.get<ProductGroup>(getUrl)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(this.log.handleError(serviceName, `get id as Observable<ProductGroup>=${id}`)),
|
catchError(this.log.handleError(serviceName, `get id=${id}`)),
|
||||||
) as Observable<ProductGroup>;
|
) as Observable<ProductGroup>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export class ProductService {
|
|||||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||||
return this.http
|
return this.http
|
||||||
.get<Product>(getUrl)
|
.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[]> {
|
list(): Observable<Product[]> {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ export class RoleService {
|
|||||||
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
const getUrl: string = id === null ? `${url}` : `${url}/${id}`;
|
||||||
return this.http
|
return this.http
|
||||||
.get<Role>(getUrl)
|
.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[]> {
|
list(): Observable<Role[]> {
|
||||||
|
|||||||
@ -7,7 +7,16 @@ import {
|
|||||||
platformBrowserDynamicTesting,
|
platformBrowserDynamicTesting,
|
||||||
} from '@angular/platform-browser-dynamic/testing';
|
} 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.
|
// First, initialize the Angular testing environment.
|
||||||
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
|
||||||
|
|||||||
Reference in New Issue
Block a user