diff --git a/packages/frontend-core/src/api/auditLogs.ts b/packages/frontend-core/src/api/auditLogs.ts index 60caca0c85..e0407f0412 100644 --- a/packages/frontend-core/src/api/auditLogs.ts +++ b/packages/frontend-core/src/api/auditLogs.ts @@ -14,48 +14,13 @@ export interface AuditLogEndpoints { getDownloadUrl: (opts: DownloadAuditLogsRequest) => string } -const buildOpts = (opts: SearchAuditLogsRequest) => { - const { bookmark, startDate, endDate, fullSearch, events, userIds, appIds } = - opts - const parsedOpts: SearchAuditLogsRequest = {} - - if (bookmark) { - parsedOpts.bookmark = bookmark - } - - if (opts.startDate && endDate) { - parsedOpts.startDate = startDate - parsedOpts.endDate = endDate - } else if (startDate && !endDate) { - parsedOpts.startDate = startDate - } - - if (fullSearch) { - parsedOpts.fullSearch = fullSearch - } - - if (events?.length) { - parsedOpts.events = events - } - - if (userIds?.length) { - parsedOpts.userIds = userIds - } - - if (appIds?.length) { - parsedOpts.appIds = appIds - } - - return parsedOpts -} - export const buildAuditLogEndpoints = ( API: BaseAPIClient ): AuditLogEndpoints => ({ searchAuditLogs: async opts => { return await API.post({ url: `/api/global/auditlogs/search`, - body: buildOpts(opts), + body: opts, }) }, getEventDefinitions: async () => {