diff --git a/src/ui_ng/src/app/log/audit-log.service.ts b/src/ui_ng/src/app/log/audit-log.service.ts index 48c8bcb6a..6cde48bda 100644 --- a/src/ui_ng/src/app/log/audit-log.service.ts +++ b/src/ui_ng/src/app/log/audit-log.service.ts @@ -36,11 +36,21 @@ export class AuditLogService { listAuditLogs(queryParam: AuditLog): Observable { let params: URLSearchParams = new URLSearchParams(queryParam.keywords); - params.set('begin_timestamp', queryParam.begin_timestamp); - params.set('end_timestamp', queryParam.end_timestamp); - params.set('username', queryParam.username); - params.set('page', queryParam.page); - params.set('page_size', queryParam.page_size); + if(queryParam.begin_timestamp) { + params.set('begin_timestamp', queryParam.begin_timestamp); + } + if(queryParam.end_timestamp) { + params.set('end_timestamp', queryParam.end_timestamp); + } + if(queryParam.username) { + params.set('username', queryParam.username); + } + if(queryParam.page) { + params.set('page', queryParam.page); + } + if(queryParam.page_size) { + params.set('page_size', queryParam.page_size); + } return this.http .get(`/api/projects/${queryParam.project_id}/logs`, {params: params}) .map(response => response)