CognxSafeTrack commited on
Commit ·
1bf0dca
1
Parent(s): 3bf9adc
fix: restore mangled interactive button calls in API service
Browse files
apps/api/src/services/whatsapp.ts
CHANGED
|
@@ -68,6 +68,12 @@ export class WhatsAppService {
|
|
| 68 |
if (isInscription) {
|
| 69 |
logger.info(`${traceId} New user registration triggered for ${phone}`);
|
| 70 |
user = await prisma.user.create({ data: { phone, organizationId } });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
{ id: 'LANG_WO', title: 'Wolof 🇸🇳' }
|
| 72 |
],
|
| 73 |
organizationId
|
|
@@ -116,6 +122,12 @@ export class WhatsAppService {
|
|
| 116 |
where: { id: user.id },
|
| 117 |
data: { city: null, activity: null }
|
| 118 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
{ id: 'LANG_WO', title: 'Wolof 🇸🇳' }
|
| 120 |
],
|
| 121 |
organizationId
|
|
|
|
| 68 |
if (isInscription) {
|
| 69 |
logger.info(`${traceId} New user registration triggered for ${phone}`);
|
| 70 |
user = await prisma.user.create({ data: { phone, organizationId } });
|
| 71 |
+
const { scheduleInteractiveButtons } = await import('./queue');
|
| 72 |
+
await scheduleInteractiveButtons(
|
| 73 |
+
user.id,
|
| 74 |
+
"Bienvenue sur Xamlé ! Quelle langue préférez-vous pour votre formation ?",
|
| 75 |
+
[
|
| 76 |
+
{ id: 'LANG_FR', title: 'Français 🇫🇷' },
|
| 77 |
{ id: 'LANG_WO', title: 'Wolof 🇸🇳' }
|
| 78 |
],
|
| 79 |
organizationId
|
|
|
|
| 122 |
where: { id: user.id },
|
| 123 |
data: { city: null, activity: null }
|
| 124 |
});
|
| 125 |
+
const { scheduleInteractiveButtons } = await import('./queue');
|
| 126 |
+
await scheduleInteractiveButtons(
|
| 127 |
+
user.id,
|
| 128 |
+
"Réinitialisation réussie. Quelle langue préférez-vous ?",
|
| 129 |
+
[
|
| 130 |
+
{ id: 'LANG_FR', title: 'Français 🇫🇷' },
|
| 131 |
{ id: 'LANG_WO', title: 'Wolof 🇸🇳' }
|
| 132 |
],
|
| 133 |
organizationId
|