From 9afd8b445741aaf387452c5b726551e7d2fe612e Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 24 May 2025 14:23:31 +0000 Subject: [PATCH] Fix: Resolve import error in CreateGroupForm The CreateGroupForm component was importing a non-existent function `cadastrarGrupoWhatsApp` from `gruposWhatsAppService.ts`. This commit corrects the import to use the available `findOrCreateWhatsAppGroup` function, which is more appropriate for the intended functionality of creating a group. --- src/components/whatsappGroups/CreateGroupForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/whatsappGroups/CreateGroupForm.tsx b/src/components/whatsappGroups/CreateGroupForm.tsx index ae76b56..64984c9 100644 --- a/src/components/whatsappGroups/CreateGroupForm.tsx +++ b/src/components/whatsappGroups/CreateGroupForm.tsx @@ -6,7 +6,7 @@ import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Loader2, Plus, AlertCircle } from 'lucide-react'; import { Alert, AlertDescription } from '@/components/ui/alert'; -import { cadastrarGrupoWhatsApp } from '@/services/gruposWhatsAppService'; +import { findOrCreateWhatsAppGroup } from '@/services/whatsAppGroupsService'; import { getUserWhatsAppInstance } from '@/services/whatsAppInstanceService'; import { createWhatsAppGroup, updateGroupRemoteJid } from '@/services/whatsAppGroupCreationService'; import { useToast } from '@/hooks/use-toast'; @@ -102,7 +102,7 @@ const CreateGroupForm = ({ userEmail, onSuccess }: CreateGroupFormProps) => { console.log("Iniciando processo de cadastro de grupo..."); // 1. Cadastrar grupo no banco de dados local - const grupo = await cadastrarGrupoWhatsApp(nomeGrupo.trim()); + const grupo = await findOrCreateWhatsAppGroup(nomeGrupo.trim()); if (!grupo) { throw new Error('Não foi possível cadastrar o grupo no banco de dados');