This commit is contained in:
gpt-engineer-app[bot] 2026-02-12 23:42:14 +00:00
parent a3cf0ae364
commit 3aec7fce19

View file

@ -112,21 +112,16 @@ export async function sendQuoteWebhook(
try {
const response = await fetch(WEBHOOK_URL, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
mode: 'no-cors',
headers: { 'Content-Type': 'text/plain' },
body: JSON.stringify(payload),
signal: controller.signal,
});
const responseBody = await response.text();
console.log('📥 Webhook response status:', response.status);
console.log('📥 Webhook response body:', responseBody);
if (!response.ok) {
return {
success: false,
error: `Webhook returned status ${response.status}. Please try again.`,
};
}
// In no-cors mode, response is opaque (status 0, no body readable).
// If fetch didn't throw, the request was sent successfully.
console.log('📥 Webhook response type:', response.type);
console.log('📥 Webhook sent successfully (no-cors mode)');
return { success: true };
} catch (err: unknown) {