mirror of
https://github.com/lingble/chatwoot.git
synced 2025-12-02 11:03:44 +00:00
- Cache campaigns for better performance - Fix N+1 queries in inbox members - Remove unused related articles
12 lines
332 B
Ruby
12 lines
332 B
Ruby
class Api::V1::Widget::CampaignsController < Api::V1::Widget::BaseController
|
|
skip_before_action :set_contact
|
|
|
|
def index
|
|
@campaigns = @web_widget
|
|
.inbox
|
|
.campaigns
|
|
.where(enabled: true, account_id: @web_widget.inbox.account_id)
|
|
.includes(:sender)
|
|
end
|
|
end
|