Skip to content
Commits on Source (3)
......@@ -42,7 +42,6 @@ class newsfeed implements Interfaces\Api
switch ($pages[0]) {
case 'single':
$activity = new Activity($pages[1]);
if (!Security\ACL::_()->read($activity)) {
return Factory::response([
'status' => 'error',
......@@ -54,7 +53,7 @@ class newsfeed implements Interfaces\Api
return Factory::response(['status' => 'error']);
}
return Factory::response(['activity' => $activity->export()]);
return Factory::response(['activity' => factory::exportable([$activity])]);
break;
default:
case 'personal':
......
......@@ -40,10 +40,6 @@ class Manager
'entities' => [],
], $opts);
if ($opts['user_guid'] === null) {
throw new \InvalidArgumentException('user_guid is required');
}
$guids = $opts['guids'] ?: array_map(function ($item) {
return $item->getGuid();
}, $opts['entities']);
......@@ -51,10 +47,6 @@ class Manager
$user = $this->entitiesBuilder->single($opts['user_guid']);
$entities = $this->entitiesBuilder->get(['guids' => $guids]);
if (!$user) {
throw new \InvalidArgumentException('User does not exist');
}
if ($user && $user->getType() !== 'user') {
throw new \InvalidArgumentException('Entity is not a user');
}
......
No preview for this file type