fix(captain): retain approved FAQ suggestion sources

This commit is contained in:
aakashb95
2026-07-22 23:29:40 +05:30
parent b4d2fa5554
commit d85ab03444
2 changed files with 1 additions and 2 deletions
@@ -16,7 +16,6 @@ class Captain::FaqSuggestionApprovalService
answer: suggestion.answer,
status: :approved
)
suggestion.observations.delete_all
suggestion.approved!
response
end
@@ -122,7 +122,7 @@ RSpec.describe 'Api::V1::Accounts::Captain::FaqSuggestions', type: :request do
expect(response).to have_http_status(:success)
expect(response.parsed_body['answer']).to eq('Enable it in account settings.')
expect(suggestion.reload).to be_approved
expect(suggestion.observations).to be_empty
expect(suggestion.observations.pluck(:conversation_id)).to contain_exactly(conversation.id)
end
it 'lets an agent approve an accessible suggestion' do