From f34517dc13ee1a956d9afa62b7f969d34e071a60 Mon Sep 17 00:00:00 2001 From: Tanmay Deep Sharma Date: Tue, 21 Apr 2026 12:41:44 +0700 Subject: [PATCH] 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) --- .../controllers/api/v1/accounts/whatsapp_calls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enterprise/app/controllers/api/v1/accounts/whatsapp_calls_controller.rb b/enterprise/app/controllers/api/v1/accounts/whatsapp_calls_controller.rb index 5555da0d1..9f0c52d65 100644 --- a/enterprise/app/controllers/api/v1/accounts/whatsapp_calls_controller.rb +++ b/enterprise/app/controllers/api/v1/accounts/whatsapp_calls_controller.rb @@ -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