feat: Add a feature flag for Audit Log UI (#7035)
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
@@ -21,6 +21,14 @@ class Api::V1::Accounts::AuditLogsController < Api::V1::Accounts::BaseController
|
||||
private
|
||||
|
||||
def fetch_audit
|
||||
@audit_logs = Current.account.associated_audits.order(created_at: :desc)
|
||||
@audit_logs = if audit_logs_enabled?
|
||||
Current.account.associated_audits.order(created_at: :desc)
|
||||
else
|
||||
Current.account.associated_audits.none
|
||||
end
|
||||
end
|
||||
|
||||
def audit_logs_enabled?
|
||||
Current.account.feature_enabled?(:audit_logs)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user