Fix broken notification link: pass explicit panel/tenant to getUrl()
Sync desde rafa/triptyk-crm@8a6e4123. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -66,8 +66,11 @@ final readonly class NotifyTeamOfNewApiLead
|
|||||||
|
|
||||||
private function resolveUrl(string $resourceClass, Company|People $record): string
|
private function resolveUrl(string $resourceClass, Company|People $record): string
|
||||||
{
|
{
|
||||||
|
// Se llama sin contexto de panel/tenant activo (p.ej. desde una
|
||||||
|
// request a /api/v1/...), así que hay que pasarlos explícitos o
|
||||||
|
// Filament::getCurrentPanel()/getTenant() devuelven null y la URL cae a '#'.
|
||||||
try {
|
try {
|
||||||
return $resourceClass::getUrl('view', ['record' => $record]);
|
return $resourceClass::getUrl('view', ['record' => $record], panel: 'app', tenant: $record->team);
|
||||||
} catch (\Throwable) {
|
} catch (\Throwable) {
|
||||||
return '#';
|
return '#';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user