refactor: simplify state updates in OrganizationSettings by removing unnecessary useEffect for filters
This commit is contained in:
@@ -99,15 +99,13 @@ export default function OrganizationSettings() {
|
|||||||
endDate: auditEndDate
|
endDate: auditEndDate
|
||||||
})
|
})
|
||||||
|
|
||||||
// Update refs when state changes
|
// Update refs when state changes (no useEffect needed)
|
||||||
useEffect(() => {
|
filtersRef.current = {
|
||||||
filtersRef.current = {
|
action: auditActionFilter,
|
||||||
action: auditActionFilter,
|
logId: auditLogIdFilter,
|
||||||
logId: auditLogIdFilter,
|
startDate: auditStartDate,
|
||||||
startDate: auditStartDate,
|
endDate: auditEndDate
|
||||||
endDate: auditEndDate
|
}
|
||||||
}
|
|
||||||
}, [auditActionFilter, auditLogIdFilter, auditStartDate, auditEndDate])
|
|
||||||
|
|
||||||
const getOrgIdFromToken = () => {
|
const getOrgIdFromToken = () => {
|
||||||
return user?.org_id || null
|
return user?.org_id || null
|
||||||
@@ -881,6 +879,7 @@ export default function OrganizationSettings() {
|
|||||||
setAuditStartDate('')
|
setAuditStartDate('')
|
||||||
setAuditEndDate('')
|
setAuditEndDate('')
|
||||||
setAuditPage(0)
|
setAuditPage(0)
|
||||||
|
setAuditFetchTrigger(prev => prev + 1)
|
||||||
}}
|
}}
|
||||||
disabled={isLoadingAudit}
|
disabled={isLoadingAudit}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user