fix(ext-api): /secretaria/ask usa chat.jid (não remoteJid inexistente)
prisma.chat.findFirst filtrava por remoteJid, que não existe no model Chat (é jid) → 500 em todo /secretaria/ask. Corrigido; endpoint retorna o reply normalmente. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -789,7 +789,7 @@ function buildExtRoutes(prisma, manager, db, config, hooks, io) {
|
||||
});
|
||||
// SEC-01+SEC-11: envia reply via WA e persiste no banco principal
|
||||
const chat = await prisma.chat.findFirst({
|
||||
where: { tenantId, remoteJid: chatId },
|
||||
where: { tenantId, jid: chatId },
|
||||
orderBy: { updatedAt: 'desc' },
|
||||
select: { id: true, instanceId: true },
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -831,7 +831,7 @@ export function buildExtRoutes(
|
||||
|
||||
// SEC-01+SEC-11: envia reply via WA e persiste no banco principal
|
||||
const chat = await prisma.chat.findFirst({
|
||||
where: { tenantId, remoteJid: chatId },
|
||||
where: { tenantId, jid: chatId },
|
||||
orderBy: { updatedAt: 'desc' },
|
||||
select: { id: true, instanceId: true },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user