feat: add audit-trails and view-audit-trail components (#406)
Fixes #404
This commit is contained in:
@@ -352,4 +352,43 @@ export class SystemService {
|
||||
return this.http.delete(`/reports/${reportId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} filterBy Properties by which entries should be filtered.
|
||||
* @param {string} orderBy Property by which entries should be sorted.
|
||||
* @param {string} sortOrder Sort order: ascending or descending.
|
||||
* @param {number} offset Page offset.
|
||||
* @param {number} limit Number of entries within the page.
|
||||
* @returns {Observable<any>} Audit Trails.
|
||||
*/
|
||||
getAuditTrails(filterBy: any, orderBy: string, sortOrder: string, offset: number, limit: number): Observable<any> {
|
||||
let httpParams = new HttpParams()
|
||||
.set('offset', offset.toString())
|
||||
.set('limit', limit.toString())
|
||||
.set('sortOrder', sortOrder)
|
||||
.set('orderBy', orderBy)
|
||||
.set('paged', 'true');
|
||||
// filterBy: actionName, entityName, resourceId, makerId, makerDateTimeFrom, makerDateTimeTo, checkerId, checkerDateTimeFrom, checkerDateTimeTo, processingResult
|
||||
filterBy.forEach(function (filter: any) {
|
||||
if (filter.value !== '') {
|
||||
httpParams = httpParams.set(filter.type, filter.value);
|
||||
}
|
||||
});
|
||||
return this.http.get('/audits', { params: httpParams });
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} auditTrailId Audit Trail ID.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getAuditTrail(auditTrailId: string): Observable<any> {
|
||||
return this.http.get(`/audits/${auditTrailId}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {Observable<any>} Audit Trail Search Template.
|
||||
*/
|
||||
getAuditTrailSearchTemplate(): Observable<any> {
|
||||
return this.http.get('/audits/searchtemplate');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user