feat: Add a feature flag for Audit Log UI (#7035)

Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
This commit is contained in:
Shivam Mishra
2023-05-09 01:14:15 +05:30
committed by GitHub
parent 683f259771
commit 2b88ecdfc4
5 changed files with 26 additions and 1 deletions

View File

@@ -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