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:
parent
b2cee3d1e5
commit
9afd8b4457
@ -6,7 +6,7 @@ import { Input } from '@/components/ui/input';
|
|||||||
import { Label } from '@/components/ui/label';
|
import { Label } from '@/components/ui/label';
|
||||||
import { Loader2, Plus, AlertCircle } from 'lucide-react';
|
import { Loader2, Plus, AlertCircle } from 'lucide-react';
|
||||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||||
import { cadastrarGrupoWhatsApp } from '@/services/gruposWhatsAppService';
|
import { findOrCreateWhatsAppGroup } from '@/services/whatsAppGroupsService';
|
||||||
import { getUserWhatsAppInstance } from '@/services/whatsAppInstanceService';
|
import { getUserWhatsAppInstance } from '@/services/whatsAppInstanceService';
|
||||||
import { createWhatsAppGroup, updateGroupRemoteJid } from '@/services/whatsAppGroupCreationService';
|
import { createWhatsAppGroup, updateGroupRemoteJid } from '@/services/whatsAppGroupCreationService';
|
||||||
import { useToast } from '@/hooks/use-toast';
|
import { useToast } from '@/hooks/use-toast';
|
||||||
@ -102,7 +102,7 @@ const CreateGroupForm = ({ userEmail, onSuccess }: CreateGroupFormProps) => {
|
|||||||
console.log("Iniciando processo de cadastro de grupo...");
|
console.log("Iniciando processo de cadastro de grupo...");
|
||||||
|
|
||||||
// 1. Cadastrar grupo no banco de dados local
|
// 1. Cadastrar grupo no banco de dados local
|
||||||
const grupo = await cadastrarGrupoWhatsApp(nomeGrupo.trim());
|
const grupo = await findOrCreateWhatsAppGroup(nomeGrupo.trim());
|
||||||
|
|
||||||
if (!grupo) {
|
if (!grupo) {
|
||||||
throw new Error('Não foi possível cadastrar o grupo no banco de dados');
|
throw new Error('Não foi possível cadastrar o grupo no banco de dados');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user