fix(posthog): simplify user identification and account usage sync

Refactor the user identification process by removing unnecessary type casting for user ID and account ID. This change enhances code readability and maintains functionality for syncing account usage.
This commit is contained in:
Paulo Castellano 2026-05-19 19:20:56 -03:00
parent ccd78e3c8d
commit da0d5f2a42

View file

@ -37,7 +37,7 @@ public function handle(PostHogService $postHog): void
return;
}
$postHog->identify((string) $user->id, [
$postHog->identify($user->id, [
'$email' => $user->email,
'$name' => $user->name,
'$set_once' => ['signed_up_at' => $user->created_at?->toIso8601String()],
@ -45,8 +45,8 @@ public function handle(PostHogService $postHog): void
if ($user->account_id) {
SyncAccountUsage::dispatch(
(string) $user->account_id,
$user->current_workspace_id ? (string) $user->current_workspace_id : null,
$user->account_id,
$user->current_workspace_id ? $user->current_workspace_id : null,
);
}
}