fix(paradizweb): confirm booking lead dispatch after contact capture
This commit is contained in:
@@ -231,9 +231,15 @@ const server = http.createServer(async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (clientId && pendingBookingByClient.get(clientId) && hasContactInfo(question) && !bookingLeadSentByClient.get(clientId)) {
|
if (clientId && pendingBookingByClient.get(clientId) && hasContactInfo(question) && !bookingLeadSentByClient.get(clientId)) {
|
||||||
await sendTelegramBookingLead(question).catch(() => {});
|
const sent = await sendTelegramBookingLead(question).catch(() => false);
|
||||||
pendingBookingByClient.delete(clientId);
|
pendingBookingByClient.delete(clientId);
|
||||||
bookingLeadSentByClient.set(clientId, true);
|
bookingLeadSentByClient.set(clientId, true);
|
||||||
|
return json(res, 200, {
|
||||||
|
ok: true,
|
||||||
|
answer: sent
|
||||||
|
? 'Спасибо! Передала заявку на бронь менеджеру, он свяжется с вами.'
|
||||||
|
: 'Спасибо! Контакт записала. Есть техническая задержка с уведомлением менеджера, но заявка сохранена.'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isExternalActionRequest(question)) {
|
if (isExternalActionRequest(question)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user