From f130380809eee9fc2ad662063606f1d937fa2e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Wed, 4 Jun 2025 16:14:48 +0200 Subject: [PATCH] Fix FLEXIAPI-320 Domain filtering in statistics --- flexiapi/app/Libraries/StatisticsGraphFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flexiapi/app/Libraries/StatisticsGraphFactory.php b/flexiapi/app/Libraries/StatisticsGraphFactory.php index 6fc1b6e..1a5e993 100644 --- a/flexiapi/app/Libraries/StatisticsGraphFactory.php +++ b/flexiapi/app/Libraries/StatisticsGraphFactory.php @@ -57,7 +57,7 @@ class StatisticsGraphFactory $fromQuery = StatisticsMessage::query(); $toQuery = StatisticsMessage::query(); - if (!Auth::user()?->isAdmin) { + if (!Auth::user()?->admin) { $fromQuery->where('from_domain', space()->domain); $toQuery->toDomain($this->domain); } elseif ($this->domain) { @@ -126,7 +126,7 @@ class StatisticsGraphFactory // Accounts doesn't have a from and to $this->domain = $this->domain ?? $this->fromDomain; - if (!Auth::user()?->isAdmin) { + if (!Auth::user()?->admin) { $this->data->where('domain', space()->domain); } elseif ($this->domain) { $this->data->where('domain', $this->domain);