From d6a377416d089597d198ddada48d37859a96236a Mon Sep 17 00:00:00 2001 From: = Date: Mon, 11 Aug 2025 15:08:42 +0530 Subject: [PATCH] feat: resolved audit log date issue in integration page --- .../AuditLogsPage/components/LogsSection.tsx | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx b/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx index dcfc6a3f0..e938aed7d 100644 --- a/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx +++ b/frontend/src/pages/organization/AuditLogsPage/components/LogsSection.tsx @@ -40,12 +40,20 @@ export const LogsSection = withPermission( }); const [timezone, setTimezone] = useState(Timezone.Local); - const [dateFilter, setDateFilter] = useState({ - startDate: new Date(Number(new Date()) - ms("1h")), - endDate: new Date(), - type: AuditLogDateFilterType.Relative, - relativeModeValue: "1h" - }); + const [dateFilter, setDateFilter] = useState( + presets?.endDate || presets?.startDate + ? { + type: AuditLogDateFilterType.Absolute, + startDate: presets?.startDate || new Date(Number(new Date()) - ms("1h")), + endDate: presets?.endDate || new Date() + } + : { + startDate: new Date(Number(new Date()) - ms("1h")), + endDate: new Date(), + type: AuditLogDateFilterType.Relative, + relativeModeValue: "1h" + } + ); useEffect(() => { if (subscription && !subscription.auditLogs) {