add review changes to refactor whatsapp es

This commit is contained in:
Tanmay Deep Sharma
2025-07-11 09:22:53 +07:00
parent b7fdeb79c2
commit f94691aecb
20 changed files with 1207 additions and 1025 deletions
@@ -129,23 +129,25 @@ export function useWhatsappEmbeddedSignup() {
try {
// Send both auth code and business info together (synchronous flow)
const accountId = store.getters.getCurrentAccountId;
const response = await fetch('/whatsapp/embedded_signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': document
.querySelector('meta[name="csrf-token"]')
?.getAttribute('content'),
...authHeaders.value,
},
body: JSON.stringify({
account_id: accountId,
code: authCode.value,
business_id: businessDataParam.business_id,
waba_id: businessDataParam.waba_id,
phone_number_id: businessDataParam.phone_number_id,
}),
});
const response = await fetch(
`/api/v1/accounts/${accountId}/whatsapp/callbacks/embedded_signup`,
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-CSRF-Token': document
.querySelector('meta[name="csrf-token"]')
?.getAttribute('content'),
...authHeaders.value,
},
body: JSON.stringify({
code: authCode.value,
business_id: businessDataParam.business_id,
waba_id: businessDataParam.waba_id,
phone_number_id: businessDataParam.phone_number_id,
}),
}
);
const responseData = await response.json();