Compare commits

..

2 Commits

Author SHA1 Message Date
lukidev 67b35bdf3e
fix: Corrige bug na função saveAgent e findAgent.
fix: Corrige bug na função saveAgent e findAgent.
2025-12-20 11:52:02 -03:00
lukibeg 1975707b0e fix: Corrige bug na função saveAgent e findAgent. 2025-12-20 11:49:17 -03:00
1 changed files with 0 additions and 9 deletions

View File

@ -51,7 +51,6 @@ public function handle(Request $request)
return response()->json(['error' => 'Fila não encontrada'], 404);
}
// Recupera Agente (se aplicável e se não for canal Local)
$agent = $this->findAgent($tenant->id, $data);
@ -249,10 +248,6 @@ private function handleJoin($queue, $data)
private function saveAgent($interface, $tenant)
{
// Ignora canais locais para não sujar o banco
if (str_starts_with($interface, 'Local/')) {
return;
}
$exists = Agent::where('tenant_id', $tenant->id)
->where('interface', $interface)
@ -296,10 +291,6 @@ private function findAgent($tenantId, $data)
{
$interface = $data['Interface'] ?? $data['MemberName'] ?? null;
// Se for canal Local/ ou nulo, retorna null para não processar
if (!$interface || str_starts_with($interface, 'Local/')) {
return null;
}
return Agent::where('tenant_id', $tenantId)
->where('interface', $interface)