fix(captain): cap FAQ source previews
This commit is contained in:
@@ -5,6 +5,7 @@ class Api::V1::Accounts::Captain::FaqSuggestionsController < Api::V1::Accounts::
|
|||||||
before_action :set_suggestion, except: [:index]
|
before_action :set_suggestion, except: [:index]
|
||||||
|
|
||||||
RESULTS_PER_PAGE = 25
|
RESULTS_PER_PAGE = 25
|
||||||
|
SOURCE_PREVIEW_LIMIT = 50
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@current_page = permitted_params[:page] || 1
|
@current_page = permitted_params[:page] || 1
|
||||||
@@ -17,6 +18,8 @@ class Api::V1::Accounts::Captain::FaqSuggestionsController < Api::V1::Accounts::
|
|||||||
@observations = @suggestion.observations
|
@observations = @suggestion.observations
|
||||||
.where(conversation_id: accessible_conversations.select(:id))
|
.where(conversation_id: accessible_conversations.select(:id))
|
||||||
.includes(:conversation)
|
.includes(:conversation)
|
||||||
|
.order(created_at: :desc)
|
||||||
|
.limit(SOURCE_PREVIEW_LIMIT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
|
|||||||
Reference in New Issue
Block a user