...
 
Commits (8)
......@@ -347,15 +347,22 @@ class comments implements Interfaces\Api
$comment = $manager->getByLuid($pages[0]);
if ($comment && $comment->canEdit()) {
if (!$comment) {
return Factory::response([
'status' => 'error',
'message' => 'Comment not found',
]);
}
if ($comment->canEdit()) {
$manager->delete($comment);
return Factory::response([]);
}
//check if owner of activity trying to remove
$entity = Entities\Factory::build($comment->getEntityGuid());
if ($entity->owner_guid == Core\Session::getLoggedInUserGuid()) {
$manager->delete($comment, [ 'force' => true ]);
$manager->delete($comment, ['force' => true]);
return Factory::response([]);
}
......
......@@ -25,6 +25,8 @@ class wallet implements Interfaces\Api
*/
public function get($pages)
{
Factory::isLoggedIn();
/** @var abstractCacher $cache */
$cache = Di::_()->get('Cache');
......
......@@ -66,7 +66,7 @@ class scheduled implements Interfaces\Api
return Factory::response([
'status' => 'success',
'count' => $manager->getScheduledCount([
'container_guid' => $container_guid,
'container_guid' => $container_guid,
'type' => $type,
'owner_guid' => $currentUser->guid,
])
......
......@@ -28,7 +28,14 @@ class transactions implements Interfaces\Api
'message' => 'There was an error returning the usd account',
]);
}
if (!$account) {
return Factory::response([
'status' => 'error',
'message' => 'Stripe account not found',
]);
}
$transactionsManger = new Stripe\Transactions\Manager();
$transactions = $transactionsManger->getByAccount($account);
......