Skip to content

Commit 207251f

Browse files
committed
(fix): subscriptions helper
1 parent d802bc6 commit 207251f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Helpers/Subscriptions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use Minds\Core;
55
use Minds\Core\Security;
66
use Minds\Core\Di\Di;
7+
use Minds\Core\EntitiesBuilder;
78
use Minds\Core\Events;
89
use Minds\Core\Subscriptions\Manager;
910
use Minds\Entities\User;
@@ -74,7 +75,7 @@ public static function registerEvents()
7475
Events\Dispatcher::register('subscription:dispatch', 'all', function (Events\Event $event) {
7576
$params = $event->getParameters();
7677

77-
$currentUser = new User($params['currentUser']);
78+
$currentUser = Di::_()->get(EntitiesBuilder::class)->single($params['currentUser']);
7879
$guids = $params['guids'];
7980

8081
if (!is_array($guids)) {
@@ -90,7 +91,7 @@ public static function registerEvents()
9091

9192
foreach ($guids as $guid) {
9293
try {
93-
$target = new User($guid);
94+
$target = Di::_()->get(EntitiesBuilder::class)->single($guid);
9495

9596
if (!($target instanceof User) || !$target->guid) {
9697
$results[] = [

0 commit comments

Comments
 (0)