Skip to content

Commit

Permalink
Merge branch 'feature/project_post' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbeig committed Nov 24, 2023
2 parents 679c0d5 + 4ce4b65 commit a697139
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ public function updatesPrivacyAction(Request $request, string $pid, string $uid)

$post = BlogPost::getBySlug($uid);

$filters = ['post' => $post->id];
$filters = ['post_id' => $post->id];
$total = PostRewardAccess::count($filters);
$postRewardAccessList = PostRewardAccess::getList($filters, 0, $total);

Expand Down
9 changes: 9 additions & 0 deletions src/Goteo/Library/PostPrivacyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,13 @@ private function canUserAccess(User $user, Post $post): bool

return false;
}

/**
* @return PostRewardAccess[]
*/
public function getLimitingRewardsForPost(Post $post): array
{
$postRewardsCount = PostRewardAccess::count(['post_id' => $post->id]);
return PostRewardAccess::getList(['post_id' => $post->id], 0, $postRewardsCount);
}
}

0 comments on commit a697139

Please sign in to comment.