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.
This commit is contained in:
gpt-engineer-app[bot] 2025-05-24 14:23:31 +00:00
parent b2cee3d1e5
commit 9afd8b4457

View File

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