fix(whatsapp-call): look up conversation by display_id in initiate

The dashboard sends the conversation's display_id (per-account sequential
number shown in URLs) as conversation_id. The controller was calling
`conversations.find()` which resolves by primary key, so every initiate
request 404'd. Align with the rest of the codebase by using
`find_by!(display_id: ...)`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tanmay Deep Sharma
2026-04-21 12:41:44 +07:00
co-authored by Claude Opus 4.7
parent ff6af338a5
commit f34517dc13
@@ -149,7 +149,7 @@ class Api::V1::Accounts::WhatsappCallsController < Api::V1::Accounts::BaseContro
end
def initiate
conversation = current_account.conversations.find(params[:conversation_id])
conversation = current_account.conversations.find_by!(display_id: params[:conversation_id])
authorize conversation, :show?
error = validate_whatsapp_calling(conversation)
return render json: { error: error }, status: :unprocessable_entity if error