Исправил ошибки связанные с интеграцией с CRM
All checks were successful
Auto Deploy / deploy (push) Successful in 16s
All checks were successful
Auto Deploy / deploy (push) Successful in 16s
This commit is contained in:
@@ -22,9 +22,9 @@ function normalizePhone(input: string) {
|
||||
}
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const apiUrl = process.env.ESPOCRM_API_URL;
|
||||
const apiKey = process.env.ESPOCRM_API_KEY;
|
||||
const leadSource = process.env.ESPOCRM_LEAD_SOURCE || "Web Site";
|
||||
const apiUrl = process.env.ESPOCRM_API_URL?.trim();
|
||||
const apiKey = process.env.ESPOCRM_API_KEY?.trim();
|
||||
const leadSource = process.env.ESPOCRM_LEAD_SOURCE?.trim() || "Web Site";
|
||||
|
||||
if (!apiUrl || !apiKey) {
|
||||
console.error("EspoCRM env is not configured");
|
||||
@@ -67,7 +67,7 @@ export async function POST(request: Request) {
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Accept: "application/json",
|
||||
"x-api-key": apiKey,
|
||||
"X-Api-Key": apiKey,
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
cache: "no-store",
|
||||
|
||||
Reference in New Issue
Block a user