We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4dcbb3a commit 0230669Copy full SHA for 0230669
src/api/controllers/instance.controller.ts
@@ -72,6 +72,15 @@ export class InstanceController {
72
status: instanceData.status,
73
});
74
75
+ // Verifica se a Instance foi criada com sucesso antes de continuar
76
+ const createdInstance = await this.prismaRepository.instance.findUnique({
77
+ where: { id: instanceId },
78
+ });
79
+
80
+ if (!createdInstance) {
81
+ throw new BadRequestException('Failed to create instance in database');
82
+ }
83
84
// Para WhatsApp Business, setInstance é async e precisa ser aguardado
85
if (instanceData.integration === Integration.WHATSAPP_BUSINESS) {
86
await (instance as any).setInstance({
0 commit comments