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');